当前位置: 首页 > news >正文

汶川县建设局网站十大招商平台

汶川县建设局网站,十大招商平台,东莞百度seo找谁,摄影网站建设的功能有哪些问题#xff1a; 我们进行了一个集成测试#xff0c;该测试创建了一个Spring ClassPathXmlApplicationContext #xff0c;同时这样做导致NoSuchMethodError爆炸。 事实证明#xff0c;我们对Spring构件的依赖版本存在冲突。 这本身不是一个不寻常的问题-使用Maven依赖插件… 问题 我们进行了一个集成测试该测试创建了一个Spring ClassPathXmlApplicationContext 同时这样做导致NoSuchMethodError爆炸。 事实证明我们对Spring构件的依赖版本存在冲突。 这本身不是一个不寻常的问题-使用Maven依赖插件使用verbose选项解决了这些问题。 但是当Maven插件错误时您该怎么办 调查 我们开始深入研究发现AbstractAutowireCapableBeanFactory的getTypeForFactoryMethod方法尝试访问GenericTypeResolver resolveReturnTypeForGeneric方法并在java.lang.NoSuchMethodError: org.springframework.core.GenericTypeResolver.resolveReturnTypeForGenericMethod(Ljava/lang/reflect/Method; 。 初步调查和谷歌搜索发现该方法是在3.2.0中添加的而我们应该在3.1.1中运行。 进一步的调查确定spring-data-mongodb依赖于范围[3.0.7-4 1的 spring框架并且由于maven在给定范围2的情况下采用了最新的可用版本因此它尝试采用3.2.2。 注意在显式版本依赖项和范围依赖项之间存在冲突的情况下上述更改有所变化但是IINM在确定spring mongo的依赖项时没有冲突。 该问题被两个症状进一步掩盖 我们还有其他使用这种模式的项目没有问题-这可以通过以下事实来解释Maven的冲突解决机制选择默认情况下找到的最近版本3 因为所有其他需要spring-data-mongodb的项目都依赖于这个项目他们很幸运地抢到了3.1.1版本而不是3.2.2 dependencytree显示它带来了3.1.1而带来了3.2.2-因为堆栈跟踪显示了其他结果所以我编写了一个测试检查上述每个类来自哪个jar并验证了AbstractAutowireCapableBeanFactory类确实来自spring-beans 3.2.2而不是3.1.1如“ mvndependencytree”所示非常感谢http://bit.ly/10zD1iV提供了在运行时查找类的jar的代码段。 Maven依赖项在构件中使用显示spring-beans3.1.1的树输出 gt:mvn dependency:tree -Dverbose -Dincludesorg.springframework ... (omitted for clarity) ... [INFO] --- maven-dependency-plugin:2.1:tree (default-cli) wix-feature-toggle-administration --- [INFO] artifact org.springframework:spring-beans: checking for updates from central [INFO] artifact org.springframework:spring-beans: checking for updates from snapshots [INFO] artifact org.springframework:spring-expression: checking for updates from central [INFO] artifact org.springframework:spring-expression: checking for updates from snapshots [INFO] artifact org.springframework:spring-tx: checking for updates from central [INFO] artifact org.springframework:spring-tx: checking for updates from snapshots [INFO] com.wixpress.common:wix-feature-toggle-administration:jar:2.180.0-SNAPSHOT ... [INFO] - org.springframework.data:spring-data-mongodb:jar:1.0.1.RELEASE:compile [INFO] | - org.springframework:spring-beans:jar:3.1.1.RELEASE:compile [INFO] | | \- (org.springframework:spring-core:jar:3.2.2.RELEASE:compile - omitted for conflict with 3.1.1.RELEASE) [INFO] | - org.springframework:spring-expression:jar:3.1.1.RELEASE:compile [INFO] | | \- (org.springframework:spring-core:jar:3.2.2.RELEASE:compile - omitted for conflict with 3.1.1.RELEASE) [INFO] | \- org.springframework.data:spring-data-commons-core:jar:1.2.1.RELEASE:compile [INFO] | - (org.springframework:spring-beans:jar:3.1.1.RELEASE:compile - omitted for duplicate) [INFO] | \- (org.springframework:spring-tx:jar:3.1.1.RELEASE:compile - omitted for duplicate) [INFO] - com.wixpress.common:wix-framework:jar:2.180.0-SNAPSHOT:compile [INFO] | - org.springframework:spring-core:jar:3.1.1.RELEASE:compile [INFO] | | \- org.springframework:spring-asm:jar:3.1.1.RELEASE:compile ... Ive removed additional outputs for clarity. The additional outputs were all 3.1.1 and were further down the tree (so irrelevant due to maven conflict resolving mechanism)工件中使用了证明spring-beans3.2.2的测试断言错误中的jvm在说什么 package com.wixpress.springVersionBug;import org.junit.*; import org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory; import org.springframework.core.GenericTypeResolver; import java.security.CodeSource; import static org.hamcrest.Matchers.endsWith;/*** author ittaiz* since 3/24/13*/public class SpringVersionTest {Testpublic void verifySpringBeans311InClasspath(){verifyCorrectSpringVersionInClasspathFor(AbstractAutowireCapableBeanFactory.class,spring-beans-3.1.1.RELEASE.jar);}Testpublic void verifySpringCore311InClasspath(){verifyCorrectSpringVersionInClasspathFor(GenericTypeResolver.class,spring-core-3.1.1.RELEASE.jar);}public void verifyCorrectSpringVersionInClasspathFor(Class springClass,String expectedJarFileName){CodeSource springClassCodeSource springClass.getProtectionDomain().getCodeSource();Assert.assertNotNull(expecting expectedJarFileName to be loaded by non-system class loader,springClassCodeSource);Assert.assertThat(springClassCodeSource.getLocation().toString(),endsWith(expectedJarFileName));} } 当spring-beans成为3.2.2时 spring-core工件出现在3.1.1中的原因是我们的框架显式依赖于spring-core而该工件显式依赖于框架。 这意味着来自框架的spring-core 3.1.1是2跳比来自spring-data-mongodb的3.2.2短。 解 依赖spring-data-mongodb同时像这样排除spring-beans dependencygroupIdorg.springframework.data/groupIdartifactIdspring-data-mongodb/artifactIdversion1.0.1.RELEASE/versionexclusionsexclusiongroupIdorg.springframework/groupIdartifactIdspring-beans/artifactId/exclusion/exclusions /dependency开放问号 为什么dependencytree在详细模式下没有显示在3.2.2中而是在3.1.1中显示spring-beans同时明确指定由于冲突而删除了spring-core 3.2.2 我将此归结为依赖项插件中的错误。 http://repo1.maven.org/maven2/org/springframework/data/spring-data-mongodb-parent/1.0.1.RELEASE/spring-data-mongodb-parent-1.0.1.RELEASE.pom ↩ http://www.maestrodev.com/better-builds-with-maven/creating-applications-with-maven/resolving-dependency-conflicts-and-using-version-ranges/ ↩ http://www.maestrodev.com/better-builds-with-maven/creating-applications-with-maven/resolving-dependency-conflicts-and-using-version-ranges/ ↩ 参考 当 Wix IO博客上的Maven依赖插件来自我们的JCG合作伙伴 Yoav Abrahami时。 翻译自: https://www.javacodegeeks.com/2013/04/when-maven-dependency-plugin-lies.html
http://www.pierceye.com/news/581302/

相关文章:

  • 邢台网站开发百度云 做网站
  • 淘宝优惠劵网站建设wordpress主题 简洁
  • 自己做电影资源网站揭阳新闻最新消息
  • 北碚免费建站哪家做得好佛山网站建设设计
  • 怎么做网站拍卖的那种wordpress主题搜索图标
  • 三亚网站建设平台查数据的权威网站
  • html网站制作答辩ppt网站备份和备案的区别
  • 网站开发需要工具免费的ps软件
  • 常州网站建设优质商家重庆互联网怎么样
  • 做网站发广告动漫网页设计报告
  • 求职招聘网站建设投标书沈阳网站建设的公司哪家好
  • 做导航网站有发展吗南京企业网站制作哪家好
  • 千万pv网站开发成本招聘网站数建设
  • 吐鲁番大型网站建设平台找客户去哪个平台
  • 权威网站有哪些给个网站可以在线
  • 优化网站专题北京海淀网站建设公司
  • 广州网站快速排名网站维护正常要多久
  • 建网站 选安全甘肃做网站价格
  • 微信公众管理平台有必要买优化大师会员吗
  • 家居网站建设素材腾讯adq广告平台
  • 响应式网站 图片居中门户网站样式
  • 潍坊网站排名推广北京建设高端网站的
  • 广东省住房和建设网站鹤壁市建设局网站
  • 北京网站建设报价明细手机网站网站开发流程
  • 三合一网站模板如何看网站是html几代做的
  • 如何设置自己的网站网站建设的常用词
  • 甘肃网站开发冷色调网站
  • 用cdr做网站设计尺寸要多少网站如何做实名验证码
  • 比较好的设计网站wordpress主题代码哪里
  • 专门学习网站建设读什么专业南山网站设计公司