启动项目时异常了,异常信息如下:
Offending resource: class path resource [template-servlet-context.xml]; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to read candidate component class: file [WEB-INF\classes\com\servlet\SpringExternalResourceServlet.class]; nested exception is org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: class path resource [java/io/Serializable.class]; nested exception is java.lang.IllegalArgumentException
Offending resource: class path resource [jpa/springdata-jpa.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [\servlet\SpringExternalResourceServlet.class]; nested exception is org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet: class path resource [java/io/Serializable.class]; nested exception is java.lang.IllegalArgumentException
异常原因:jdk不匹配,替换jdk版本即可
1.检查一下Spring版本和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
本文档探讨了项目启动时遇到的异常,指出问题在于JDK版本不匹配。解决方案是检查并更新Spring(5.3.x对应JDK8-17,5.2.x对应JDK8-15等),确保与使用的Spring版本兼容。

1758

被折叠的 条评论
为什么被折叠?



