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文件夹下的你的项目这个目录 **

BeanCreationException是Spring框架中的一个异常,表示在创建Bean时出现了错误。该异常通常包含详细的错误信息,能够帮助我们找到问题所在。在你提供的引用中,有两个例子都涉及到了BeanCreationException异常。 引用中的BeanCreationException是在创建名为'transactionManager'的bean时发生的错误,错误信息中提到文件路径[F:\IdeaProjects\ssmDemo1\out\artifacts\ssmDemo1_war_exp]。根据这些信息,我们可以初步判断问题可能是文件路径或配置的错误导致的。 引用中的BeanCreationException是在配置Redis的时候发生的错误,错误信息中提到无法配置Redis的keyspace notifications。根据错误信息提供的链接,我们可以点击链接查看更详细的解决方法。 综上所述,BeanCreationException是在创建Bean时出现的错误,在你提供的例子中有两个不同的情况。一个是文件路径或配置的错误,另一个是配置Redis时的错误。具体解决方法需要根据具体的错误信息和配置来确定。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [ssmDemo1:SSM框架整合练习项目 来自《2017-7黑马49期web》](https://download.csdn.net/download/weixin_42097914/18258169)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* *3* [BeanCreationException: Error creating bean with name 'enableRedisKeyspaceNotificationsInitializer'](https://blog.csdn.net/oDianZi1234567/article/details/103774172)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值