Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring-mybatis.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [G:通州学习java学习.metadata.pluginsorg.eclipse.wst.server.coretmp0wtpwebappsssmWEB-INFclassesmapperAdminDaoImpl.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'Admin'. Cause: java.lang.ClassNotFoundException: Cannot find class: Admin
看异常栈需要抓重点,
那么你的错误重点在于最后一句
应该是你的mapper使用了 Admin 而不是包名+Admin
解决方案 两种
1、
将AdminDaoImpl.xml 中所有的Admin改成包名+Admin
2、
新建mybatis-config.xml
配置别名
在spring-mybatis.xml 引入mybatis配置
最后,编码不易 望采纳。