org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:spring-service.xml]
Offending resource: class path resource [applicationContext.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [D:scriptsIDEAssmbuildtargetclassescomkuangserviceBookService.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: file [D:scriptsIDEAssmbuildtargetclassescomkuangserviceBookService.class]; nested exception is java.lang.IllegalArgumentException: Unsupported class file major version 57
java.lang.IllegalArgumentException: Unsupported class file major version 57
错误排查原因:可能是当前项目与运行的 JDK 不兼容。 解决方法:将 JDK 升级或降级SSM 框架整合使用的是 JDK 版本是jdk13,现在考虑升级JDK版本。在经过将 jdk 从13 改到16,16改到17 之后,依旧是该问题。
接下来开始在代码中找错误:最终找到两处错误:
(1) j接口配置文件 BookMapper.xml 是由 mybatis-config.xml 文件更改来的,需要将 mybatis-config.xml 头部中的 config 改为 mapper, 共需要更改4处。少一处可能会出现 5xx 的错误。
(2)更改完上面的错误之后,可能会出现 找不到配置文件 spring-service.xml spring-mvc.xml 等错误,在查找了很多解决方法之后,存在的原因是: pom.xml 配置文件中需要导入 maven-compiler-plugin
导入该插件之后,刷新 Maven 成功!



