栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

SSM整合出现错误

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

SSM整合出现错误

控制台错误显示:

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

运行Tomcat显示错误:

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 成功!

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/602842.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号