栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

java.lang.NoSuchMethodError:org.springframework.core.annotation.AnnotationUtils.isInJavaLangAnnotati

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

java.lang.NoSuchMethodError:org.springframework.core.annotation.AnnotationUtils.isInJavaLangAnnotati

问题在于你正在混合使用不同版本的Spring,在项目中混合使用了(2.0.8、3.1.4和4.0.2)。那是等待发生的麻烦。

为防止此类情况,现在可以导入一个所谓的”bill of materials” POM。

你需要添加dependencyManagement部分以导入BOM。

<dependencyManagement>    <dependencies>        <dependency> <groupId>org.springframework</groupId> <artifactId>spring-framework-bom</artifactId> <version>4.0.5.RELEASE</version> <type>pom</type> <scope>import</scope>        </dependency>    </dependencies></dependencyManagement>

现在,在依赖项中,你可以删除版本并替换

spring-dao
spring-orm
。额外的好处是,所有
spring- *
依赖项现在都将被管理到最新版本,并且你的版本号只有一个位置。

<dependency>    <groupId>org.springframework</groupId>    <artifactId>spring-beans</artifactId></dependency><dependency>    <groupId>org.springframework</groupId>    <artifactId>spring-context</artifactId></dependency><dependency>    <groupId>org.springframework</groupId>    <artifactId>spring-context-support</artifactId></dependency><dependency>    <groupId>org.springframework</groupId>    <artifactId>spring-core</artifactId></dependency><dependency>    <groupId>org.springframework</groupId>    <artifactId>spring-jdbc</artifactId></dependency><dependency>    <groupId>org.springframework</groupId>    <artifactId>spring-orm</artifactId></dependency>

你可以对Spring Data应用相同的技巧,因为它也具有bom。



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

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

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