启动项目时异常了,异常信息如下:
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