org.springframework.beans.factory.BeanCreationException: Error creating bean with name 解决办法

本文解决了在使用IntelliJ IDEA运行项目时遇到的“Exception encountered during context initialization”错误,并详细记录了通过调整Java Compiler设置中的JDK版本来解决此问题的过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

本人在运行idea Demo时出出现的

Exception encountered during context initialization - cancelling refresh attempt

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0': Invocation of init method failed; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException:

后面的错误也是围绕这两个

.CannotLoadBeanClassException


 UnsupportedClassVersionError:


打开Java  Compiler

file----->settings---->Build,Execution,Deployment------>Compiler----->Java  Compiler


修改JDK原先1.8版本为1.6或者1.7 再次运行后  成功。


另外本人Tomcat 版本为7

具体原因不了解,希望有大神可以交流交流,


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值