IDEA关于之前还好好的 突然就各种create bean不行了的问题BeanCreationException: Error creating bean with name

如果你实在不知道怎么回事不如按照我说的做一下

[org.springframework.web.context.support.XmlWebApplicationContext] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘testController’: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.laozhu.service.TestService com.laozhu.controller.TestController.testService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘testService’: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.laozhu.dao.TestMapper com.laozhu.srv.imp.TestServiceImp.testMapper; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘testMapper’ defined in file [Z:\IdeaProjects\SpringMVC_test\SpringMVC_SSM\target\SpringMVC_SSM\WEB-INF\classes\com\laozhu\dao\TestMapper.class]: Cannot resolve reference to bean ‘sqlSessionFactory’ while setting bean property ‘sqlSessionFactory’; nested exception is org.springframework.beans.factory.BeanCreationException: 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 [Z:\IdeaProjects\SpringMVC_test\SpringMVC_SSM\target\SpringMVC_SSM\WEB-INF\classes\com\laozhu\mapping\UserMapper.xml]’; nested exception is org.apache.ibatis.builder.BuilderException: Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 8; columnNumber: 5; 元素类型 “result” 必须后跟属性规范 “>” 或 “/>”。

**重点是这里Error creating bean with name ‘testMapper’ defined in file [Z:\IdeaProjects\SpringMVC_test\SpringMVC_SSM\target\SpringMVC_SSM\WEB-INF\classes\com\laozhu\dao\TestMapper.class
这个缓存没有删除 本地删除掉target文件夹下的你的项目这个目录 **

  • 0
    点赞
  • 0
    评论
  • 0
    收藏
  • 打赏
    打赏
  • 扫一扫,分享海报

参与评论 您还未登录,请先 登录 后发表或查看评论
©️2022 CSDN 皮肤主题:大白 设计师:CSDN官方博客 返回首页

打赏作者

大黄豆丶Z

你的鼓励将是我创作的最大动力

¥2 ¥4 ¥6 ¥10 ¥20
输入1-500的整数
余额支付 (余额:-- )
扫码支付
扫码支付:¥2
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值