错误原因:
Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException:
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:150)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)
at com.wyy.test.Testsql.main(Testsql.java:22)
Caused by: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.wyy.mapperCustomerMapper.fincustomerbyname
at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:875)
at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:708)
at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:701)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)
... 2 more
感觉是sql语句错了,但我看了好久感觉没问题呀
一个明显的错误
com.wyy.mapperCustomerMapper.fincustomerbyname
少了一个标点
com.wyy.mapper.CustomerMapper.fincustomerbyname
谢谢,成功了
你可以试着把sql语句打印出来看下是不是错了