Forums Register Login

MYBATIS MAPPING ERROR on 3.2.7 but GOOD on 3.0.3

+Pie Number of slices to send: Send
Hello guys I'm experiencing a mapping error on my project when using mybatis 3.2.7.jar but Im having a good time when using mybatis 3.0.

(trial is based on loaine sample hello world mybatis) please see whole sample project file here:







log4j:WARN No appenders could be found for logger (org.apache.ibatis.logging.LogFactory). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException:
Error updating database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for Customer.updateByPrimaryKeySelective
Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for Customer.updateByPrimaryKeySelective

at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:26)
at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:154)
at test.dao.CustomerDAO.updateByPrimaryKeySelective(CustomerDAO.java:91)
at test.trial.main.main(main.java:27)

Caused by: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for Customer.updateByPrimaryKeySelective at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:797) at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:631) at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:624) at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:151) ... 2 more
+Pie Number of slices to send: Send
How have you loaded the mapping files? The exception suggests it cannot find the mapping "updateByPrimaryKeySelective"
+Pie Number of slices to send: Send
+Pie Number of slices to send: Send
Here's my structure....

SQL Session is pointing to SQLMAPCONFIG.XML
mapping and queries are pointed to CustomerMapper.xml
mybatis.png
structure
[mybatis.png]
+Pie Number of slices to send: Send
Kristian

I cannot access that download at the moment.

Could you show the load that loads the XML files? I suspect they are not being found?

BTW, are you able to run any of the other named myBatis statements?

Please also use code tags where appropriate in your posts. I have added them for you this time.
+Pie Number of slices to send: Send
Hi James,

thanks for your help.... its

+Pie Number of slices to send: Send
Hi James, by the way

using mybatis 3.0.3 it is a success! but when I converted my library from 3.0.3 to 3.2.7... it doesn't work anymore... then reverts to mybatis 3.0.3 it works again
+Pie Number of slices to send: Send
I don't see CustomerMapper.xml listed in the file, should it not be present?
+Pie Number of slices to send: Send
Hi james,

Sorry a while a go i posted the wrong config:)
yeah, but ... what would PIE do? Especially concerning this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 2911 times.
Similar Threads
Hibernate Newbie - 1 to Many Relation Tutorial
How does IBatis/MyBatis maps jdbcType=CURSOR to javaType=java.sql.ResultSet.
MyBatis foreach error
running an external program from servlet
error: Parameter index out of range (3 > number of parameters, which is 2).
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 18:32:41.