采纳答案成功!
向帮助你的同学说点啥吧!感谢那些助人为乐的人
按提示说是spring-dao层的sqlSessionFactory出错 这是sqlSessionFactory的代码,实体类的包确实放在com.qml.o3o.entity中, AreaDao.xml里的命名空间也确认过了,还是没有解决,想请教一下老师这是哪里出了问题啊
同学好,错误没截全呀,error bean后面的信息不全,同时ut里面的failure trace也给出来一下。
error bean后面的截图在第一张图下面。 failure trace在哪里查看呢?
init failed后面的nested是什么Error 同学要不直接把异常复制粘贴出来吧。failure trace就是你ut执行的时候,会有一栏显示ut的执行结果的
警告: 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 [D:\Program File\javaIDE\java_workspace\o3o\target\classes\mapper\AreaDao.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.Area'. Cause: java.lang.ClassNotFoundException: Cannot find class: com.imooc.o2o.entity.Area 三月 29, 2019 1:31:11 下午 org.springframework.test.context.TestContextManager prepareTestInstance 严重: Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@6b143ee9] to prepare test instance [com.qml.o3o.dao.AreaDaoTest@2df9b86] java.lang.IllegalStateException: Failed to load ApplicationContext
登录后可查看更多问答,登录/注册
SSM商铺V1.0,解决毕设痛点;SpringBoot商铺V2.0,满足工作刚需
2.0k 47
1.9k 41
2.6k 40
1.9k 39
1.6k 37