BeanDefinitionStoreException: Failed to read candidate component class probably due to a new Java

学习Spring MVC注解时,踩过的坑。

错误:BeanDefinitionStoreException: Failed to read candidate component class

要注意不同 Spring Framework 版本对应的 JDK 版本

Spring Framework 5.3.x: JDK 8-17 (expected)
Spring Framework 5.2.x: JDK 8-15 (expected)
Spring Framework 5.1.x: JDK 8-12
Spring Framework 5.0.x: JDK 8-10
Spring Framework 4.3.x: JDK 6-8

方法一:

        修改Spring Framework版本

方法二:

        修改Java项目中目标字节码的名称

 将项目目标字节码版本改为对应 Spring Framework 版本即可!


参考:https://blog.csdn.net/Zilong0128/article/details/120619834

猜你喜欢

转载自blog.csdn.net/m0_46745664/article/details/124928441
今日推荐