今天在GITHUB找了一个书城的源码,在导入后,发现错误,更新部分版本问题后,发现该错误较难解决。
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [book-context.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [F:\javaweb\Spring-01\bookcity\src\main\webapp\WEB-INF\classes\MyBatis\book.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [F:\javaweb\Spring-01\bookcity\src\main\webapp\WEB-INF\classes\MyBatis\book.xml]'. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'com.library.bean.Book'. Cause: java.lang.ClassNotFoundException: Cannot find class: com.library.bean.Book
这里说找不到bean,查找网上提示要把resulttype改为,resultmap,改完之后发现错误一直没有消失
开始漫长的试错,在更改其他配置无果后,发现parametertype也存在错误,
那么更改此为parametertype后,TOMCAT可以成功配置,之后又有500的错误,慢慢解决