警告: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sqlSessionFactory’ defined in class path resource [spring/spring-dao.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: ‘file [E:\o20\target\classes\mapper\WechatAuthDao.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.imooc.o2o.entity.WechatAuth’. Cause: java.lang.ClassNotFoundException: Cannot find class: com.imooc.o2o.entity.WechatAuth
因为是练习项目,所以mapper.xml文件导入全了,entity包下少复制了一个实体类,所以报错。