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,即可解决问题!

  • 相关阅读:
    vue中mixins的使用方法和注意点(详)
    vue中异步组件实现按需加载
    Vue动态组件
    Vue中slot的介绍与使用
    vue面试(二)
    菜单加载学习1
    NPOI,导出Execl,压缩文件zip,发送Email
    使用Microsoft EnterpriseLibrary(微软企业库)日志组件把系统日志写入数据库和xml文件
    框架公用方法
    Model Validation 和测试Post参数
  • 原文地址:https://www.cnblogs.com/lykbk/p/werwerwer3454354354.html
Copyright © 2011-2022 走看看