zoukankan      html  css  js  c++  java
  • redis 集群java.lang.NoSuchMethodError:SpringJAR包版本冲突错误解决方法

     

     

      项目中出现如下错误,记录下解决方法:

    org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [META-INF/spring/community-context.xml]; nested exception is java.lang.NoSuchMethodError: org.springframework.beans.factory.support.DefaultListableBeanFactory.getDependencyComparator()Ljava/util/Comparator;
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
    at 
    查询了相关资料,大部分都说引起的原因是JAR包错误或JAR包冲突,查看了配置文件,并没有发现错误之处,因为用的是maven工程,这让我想到了maven的JAR引用的传递性,应该是引用的JAR包中传递引用了相同的包,没有排除。通过mvn dependency:tree 命令查看当前工程引用的依赖JAR树

    发引用了不同版本的:

    org.springframework:spring-beans:jar:4.2.6.RELEASE:compile //当前项目spring版本引用的

    org.springframework:spring-beans:jar:3.2.8.RELEASE:compile //maven依赖JAR中传递引用的版本(排除这个依赖,就可以启动成功了)

    总结:遇到此错误应该是JAR包版本冲突,查看maven依赖的JAR包结构,排除多余引用的JAR,即可解决问题!

  • 相关阅读:
    梦断代码第8章总结
    <<梦断代码>>读后感
    站立会议第四篇
    购买一批书的最低价格
    NABCD分析
    首尾相连的二维数组求最大字数组的和
    站立会议第三篇
    站立会议第二篇
    站立会议第一篇
    牛客算法周周练16D Rinne Loves Dynamic Graph(分层图最短路 + 堆优化dijkstra)
  • 原文地址:https://www.cnblogs.com/lykbk/p/werwerwer3454354354.html
Copyright © 2011-2022 走看看