解决idea中报错Failed to read candidate component class: file [ ]; nested exception is org.

使用的 Spring 依赖与 JDK 版本不兼容所导致的。换句话说,相对于 Spring 的版本Spring 5.1.5.RELEASE,JDK 的版本JDK 15太高了。

解决办法

将porm.xml中的spring-context版本调高,重新加载maven即可。

    <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>5.2.5.RELEASE</version>
    </dependency>

版权声明:本文为wfqiaodaima原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://blog.csdn.net/wfqiaodaima/article/details/124519684