Error creating bean with name 'sqlSessionFactory'

来源:9-1 首页后台的开发

慕丝9530589

2018-06-10

警告: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in file [C:\Program Files\Apache Software Foundation\Tomcat 8.0_Tomcat8.0\wtpwebapps\o2o\WEB-INF\classes\spring\spring-dao.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [C:\Program Files\Apache Software Foundation\Tomcat 8.0_Tomcat8.0\wtpwebapps\o2o\WEB-INF\classes\mapper\ProductDao.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 'com.tmy.o2o.entity.ProductImg'.  Cause: java.lang.ClassNotFoundException: Cannot find class: com.tmy.o2o.entity.ProductImg

六月 10, 2018 10:37:41 上午 org.springframework.web.servlet.DispatcherServlet initServletBean

严重: Context initialization failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in file [C:\Program Files\Apache Software Foundation\Tomcat 8.0_Tomcat8.0\wtpwebapps\o2o\WEB-INF\classes\spring\spring-dao.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [C:\Program Files\Apache Software Foundation\Tomcat 8.0_Tomcat8.0\wtpwebapps\o2o\WEB-INF\classes\mapper\ProductDao.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 'com.tmy.o2o.entity.ProductImg'.  Cause: java.lang.ClassNotFoundException: Cannot find class: com.tmy.o2o.entity.ProductImg


写回答

1回答

翔仔

2018-06-10

同学好,此类问题非常明显,期待你独立解决顺便加强自我定位问题和解决问题的能力。这里我们一般看caused by 附近的错误,这里是说的你的com.xxxxxx.ProductImg这个类不存在 请仔细检查

0
0

Java双版本(SSM到SpringBoot)校园商铺全栈开发

SSM商铺V1.0,解决毕设痛点;SpringBoot商铺V2.0,满足工作刚需

5137 学习 · 8152 问题

查看课程