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项目中目标字节码的名称

BeanDefinitionStoreException: Failed to read candidate component class probably due to a new Java_第1张图片

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


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

你可能感兴趣的:(后端,spring,spring,mvc,java,开发语言)