Maven 多模块引用版本的问题 java.lang.NoSuchMethodError

环境:Junit测试用例 java.lang.NoSuchMethodError

很明显的错误,肯定是jar版本的问题

前提 Maven 打包并没有这个的问题,估计是做了优化处理

原测试代码

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath*:/META-INF/spring/root_test.xml"})
@ActiveProfiles("production")
public class SpringRoot {

}

第一步:找到指定class

public class SpringRoot {
    @Test
    public void test(){     //加载
        System.out.println(AnnotatedElementUtils.class);
        //查找引用的路径      System.out.println(AnnotatedElementUtils.class.getResource(""));
    }
}
class org.springframework.core.annotation.AnnotatedElementUtils
jar:file:/D:/maven/.m2/repository/org/springframework/spring-core/4.1.5.RELEASE/spring-core-4.1.5.RELEASE.jar!/org/springframework/core/annotation/

找到问题点

大家都用4.1.5的版本,此人竟然用4.1.5

第二步:AppClassLoader到底加载了哪些jar

/*@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {"classpath*:/META-INF/spring/root_test.xml"})
@ActiveProfiles("production")*/
public class SpringRoot {
    @Test
    public void test(){
        System.out.println(AnnotatedElementUtils.class);
        System.out.println(AnnotatedElementUtils.class.getResource(""));
        for(String s:System.getProperty("java.class.path").split(";")){
            System.out.println(s);
        }

    }
}
class org.springframework.core.annotation.AnnotatedElementUtils
jar:file:/D:/maven/.m2/repository/org/springframework/spring-core/4.1.5.RELEASE/spring-core-4.1.5.RELEASE.jar!/org/springframework/core/annotation/
D:\workPlace\ces\yitai-all-project\yitai-educational-web\target\test-classes
D:\workPlace\ces\yitai-all-project\yitai-educational-web\target\classes
D:\workPlace\ces\yitai-all-project\yitai-educational-service\target\classes
D:\workPlace\ces\yitai-all-project\yitai-educational-service\target\test-classes
D:\workPlace\ces\yitai-all-project\yitai-ces-api\target\classes
D:\workPlace\ces\yitai-all-project\yitai-ces-api\target\test-classes
D:\maven\.m2\repository\org\activiti\activiti-modeler\5.21.0\activiti-modeler-5.21.0.jar
D:\maven\.m2\repository\org\activiti\activiti-common-rest\5.21.0\activiti-common-rest-5.21.0.jar
D:\maven\.m2\repository\org\activiti\activiti-json-converter\5.21.0\activiti-json-converter-5.21.0.jar
D:\maven\.m2\repository\org\activiti\activiti-bpmn-model\5.21.0\activiti-bpmn-model-5.21.0.jar
D:\maven\.m2\repository\joda-time\joda-time\2.6\joda-time-2.6.jar
D:\maven\.m2\repository\math\geom2d\javaGeom\0.11.1\javaGeom-0.11.1.jar
D:\maven\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.2.3\jackson-core-2.2.3.jar
D:\maven\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.2.3\jackson-databind-2.2.3.jar
D:\maven\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.2.3\jackson-annotations-2.2.3.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\batik-parser\1.7\batik-parser-1.7.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\batik-awt-util\1.7\batik-awt-util-1.7.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\batik-util\1.7\batik-util-1.7.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\batik-xml\1.7\batik-xml-1.7.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\batik-transcoder\1.7\batik-transcoder-1.7.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\fop\0.94\fop-0.94.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\xmlgraphics-commons\1.2\xmlgraphics-commons-1.2.jar
D:\maven\.m2\repository\commons-io\commons-io\1.1\commons-io-1.1.jar
D:\maven\.m2\repository\org\apache\avalon\framework\avalon-framework-api\4.3.1\avalon-framework-api-4.3.1.jar
D:\maven\.m2\repository\org\apache\avalon\framework\avalon-framework-impl\4.3.1\avalon-framework-impl-4.3.1.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\batik-dom\1.7\batik-dom-1.7.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\batik-gvt\1.7\batik-gvt-1.7.jar
D:\maven\.m2\repository\xml-apis\xml-apis-ext\1.3.04\xml-apis-ext-1.3.04.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\batik-bridge\1.7\batik-bridge-1.7.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\batik-anim\1.7\batik-anim-1.7.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\batik-ext\1.7\batik-ext-1.7.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\batik-script\1.7\batik-script-1.7.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\batik-js\1.7\batik-js-1.7.jar
D:\maven\.m2\repository\xml-apis\xml-apis\1.3.04\xml-apis-1.3.04.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\batik-codec\1.7\batik-codec-1.7.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\batik-css\1.7\batik-css-1.7.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\batik-svg-dom\1.7\batik-svg-dom-1.7.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\batik-svggen\1.7\batik-svggen-1.7.jar
D:\maven\.m2\repository\org\activiti\activiti-diagram-rest\5.21.0\activiti-diagram-rest-5.21.0.jar
D:\maven\.m2\repository\org\activiti\activiti-spring\5.21.0\activiti-spring-5.21.0.jar
D:\maven\.m2\repository\org\activiti\activiti-engine\5.21.0\activiti-engine-5.21.0.jar
D:\maven\.m2\repository\org\activiti\activiti-bpmn-converter\5.21.0\activiti-bpmn-converter-5.21.0.jar
D:\maven\.m2\repository\org\activiti\activiti-process-validation\5.21.0\activiti-process-validation-5.21.0.jar
D:\maven\.m2\repository\org\activiti\activiti-image-generator\5.21.0\activiti-image-generator-5.21.0.jar
D:\maven\.m2\repository\org\apache\commons\commons-email\1.4\commons-email-1.4.jar
D:\maven\.m2\repository\com\sun\mail\javax.mail\1.5.2\javax.mail-1.5.2.jar
D:\maven\.m2\repository\javax\activation\activation\1.1.1\activation-1.1.1.jar
D:\maven\.m2\repository\org\mybatis\mybatis\3.3.0\mybatis-3.3.0.jar
D:\maven\.m2\repository\org\apache\commons\commons-lang3\3.3.2\commons-lang3-3.3.2.jar
D:\maven\.m2\repository\commons-dbcp\commons-dbcp\1.4\commons-dbcp-1.4.jar
D:\maven\.m2\repository\commons-pool\commons-pool\1.5.4\commons-pool-1.5.4.jar
D:\maven\.m2\repository\org\slf4j\slf4j-api\1.7.6\slf4j-api-1.7.6.jar
D:\maven\.m2\repository\org\slf4j\jcl-over-slf4j\1.7.6\jcl-over-slf4j-1.7.6.jar
D:\maven\.m2\repository\org\iff\tc-util-project\1.0.13\tc-util-project-1.0.13.jar
D:\maven\.m2\repository\org\jboss\resteasy\jaxrs-api\3.0.7.Final\jaxrs-api-3.0.7.Final.jar
D:\maven\.m2\repository\org\apache\curator\curator-recipes\2.9.0\curator-recipes-2.9.0.jar
D:\maven\.m2\repository\org\apache\curator\curator-framework\2.9.0\curator-framework-2.9.0.jar
D:\maven\.m2\repository\org\apache\curator\curator-client\2.9.0\curator-client-2.9.0.jar
D:\maven\.m2\repository\com\google\guava\guava\16.0.1\guava-16.0.1.jar
D:\maven\.m2\repository\org\apache\zookeeper\zookeeper\3.4.6\zookeeper-3.4.6.jar
D:\maven\.m2\repository\org\slf4j\slf4j-log4j12\1.6.1\slf4j-log4j12-1.6.1.jar
D:\maven\.m2\repository\log4j\log4j\1.2.16\log4j-1.2.16.jar
D:\maven\.m2\repository\jline\jline\0.9.94\jline-0.9.94.jar
D:\maven\.m2\repository\junit\junit\3.8.1\junit-3.8.1.jar
D:\maven\.m2\repository\io\netty\netty\3.7.0.Final\netty-3.7.0.Final.jar
D:\maven\.m2\repository\org\springframework\spring-web\4.1.5.RELEASE\spring-web-4.1.5.RELEASE.jar
D:\maven\.m2\repository\org\springframework\spring-webmvc\4.1.5.RELEASE\spring-webmvc-4.1.5.RELEASE.jar
D:\maven\.m2\repository\org\springframework\spring-expression\4.1.5.RELEASE\spring-expression-4.1.5.RELEASE.jar
D:\maven\.m2\repository\org\springframework\spring-beans\4.1.5.RELEASE\spring-beans-4.1.5.RELEASE.jar
D:\maven\.m2\repository\org\springframework\spring-orm\4.1.5.RELEASE\spring-orm-4.1.5.RELEASE.jar
D:\maven\.m2\repository\org\springframework\spring-context\4.1.5.RELEASE\spring-context-4.1.5.RELEASE.jar
D:\maven\.m2\repository\org\springframework\spring-context-support\4.1.5.RELEASE\spring-context-support-4.1.5.RELEASE.jar
D:\maven\.m2\repository\org\springframework\spring-aop\4.1.5.RELEASE\spring-aop-4.1.5.RELEASE.jar
D:\maven\.m2\repository\org\springframework\spring-jdbc\4.1.5.RELEASE\spring-jdbc-4.1.5.RELEASE.jar
D:\maven\.m2\repository\org\springframework\spring-tx\4.1.5.RELEASE\spring-tx-4.1.5.RELEASE.jar
D:\maven\.m2\repository\org\springframework\spring-test\4.1.5.RELEASE\spring-test-4.1.5.RELEASE.jar
D:\maven\.m2\repository\org\springframework\spring-core\4.1.5.RELEASE\spring-core-4.1.5.RELEASE.jar
D:\maven\.m2\repository\commons-logging\commons-logging\1.2\commons-logging-1.2.jar
D:\workPlace\ces\yitai-all-project\yitai-common\target\test-classes
D:\workPlace\ces\yitai-all-project\yitai-common\target\classes
D:\maven\.m2\repository\junit\junit\4.11\junit-4.11.jar
D:\maven\.m2\repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar
D:\maven\.m2\repository\com\google\guava\guava\17.0\guava-17.0.jar
D:\maven\.m2\repository\org\slf4j\slf4j-api\1.7.7\slf4j-api-1.7.7.jar
D:\maven\.m2\repository\org\aspose-words\16.8.0\aspose-words-16.8.0-jdk16.jar
D:\maven\.m2\repository\org\mybatis\mybatis\3.2.7\mybatis-3.2.7.jar
D:\maven\.m2\repository\org\mybatis\mybatis-spring\1.2.2\mybatis-spring-1.2.2.jar
D:\maven\.m2\repository\org\apache\httpcomponents\httpclient\4.4.1\httpclient-4.4.1.jar
D:\maven\.m2\repository\org\apache\httpcomponents\httpcore\4.4.1\httpcore-4.4.1.jar
D:\maven\.m2\repository\commons-codec\commons-codec\1.9\commons-codec-1.9.jar
D:\maven\.m2\repository\commons-httpclient\commons-httpclient\3.0\commons-httpclient-3.0.jar
D:\maven\.m2\repository\org\csource\fastdfs-client-java\1.25\fastdfs-client-java-1.25.jar
D:\maven\.m2\repository\net\sf\json-lib\json-lib\2.4\json-lib-2.4-jdk15.jar
D:\maven\.m2\repository\commons-beanutils\commons-beanutils\1.8.0\commons-beanutils-1.8.0.jar
D:\maven\.m2\repository\commons-collections\commons-collections\3.2.1\commons-collections-3.2.1.jar
D:\maven\.m2\repository\commons-lang\commons-lang\2.5\commons-lang-2.5.jar
D:\maven\.m2\repository\net\sf\ezmorph\ezmorph\1.0.6\ezmorph-1.0.6.jar
D:\maven\.m2\repository\redis\clients\jedis\2.7.3\jedis-2.7.3.jar
D:\maven\.m2\repository\org\apache\commons\commons-pool2\2.3\commons-pool2-2.3.jar
D:\maven\.m2\repository\com\belerweb\pinyin4j\2.5.0\pinyin4j-2.5.0.jar
D:\maven\.m2\repository\javax\servlet\javax.servlet-api\3.0.1\javax.servlet-api-3.0.1.jar
D:\maven\.m2\repository\com\google\code\gson\gson\2.3.1\gson-2.3.1.jar
D:\maven\.m2\repository\com\alibaba\fastjson\1.2.16\fastjson-1.2.16.jar
D:\maven\.m2\repository\de\idyl\winzipaes\1.0.1\winzipaes-1.0.1.jar
D:\maven\.m2\repository\org\bouncycastle\bcprov-jdk16\1.45\bcprov-jdk16-1.45.jar
D:\maven\.m2\repository\org\apache\poi\poi\3.10-FINAL\poi-3.10-FINAL.jar
D:\maven\.m2\repository\org\apache\poi\poi-ooxml\3.10-FINAL\poi-ooxml-3.10-FINAL.jar
D:\maven\.m2\repository\org\apache\poi\poi-ooxml-schemas\3.10-FINAL\poi-ooxml-schemas-3.10-FINAL.jar
D:\maven\.m2\repository\org\apache\xmlbeans\xmlbeans\2.3.0\xmlbeans-2.3.0.jar
D:\maven\.m2\repository\stax\stax-api\1.0.1\stax-api-1.0.1.jar
D:\maven\.m2\repository\dom4j\dom4j\1.6.1\dom4j-1.6.1.jar
D:\maven\.m2\repository\org\apache\poi\poi-examples\3.10-FINAL\poi-examples-3.10-FINAL.jar
D:\maven\.m2\repository\org\apache\poi\poi-scratchpad\3.10-FINAL\poi-scratchpad-3.10-FINAL.jar
D:\maven\.m2\repository\net\lingala\zip4j\zip4j\1.3.2\zip4j-1.3.2.jar
D:\maven\.m2\repository\org\json\json\20090211\json-20090211.jar
D:\maven\.m2\repository\com\openhtmltopdf\openhtmltopdf-core\0.0.1-RC11\openhtmltopdf-core-0.0.1-RC11.jar
D:\maven\.m2\repository\com\openhtmltopdf\openhtmltopdf-pdfbox\0.0.1-RC11\openhtmltopdf-pdfbox-0.0.1-RC11.jar
D:\maven\.m2\repository\org\apache\pdfbox\pdfbox\2.0.5\pdfbox-2.0.5.jar
D:\maven\.m2\repository\org\apache\pdfbox\fontbox\2.0.5\fontbox-2.0.5.jar
D:\maven\.m2\repository\de\rototor\pdfbox\graphics2d\0.3\graphics2d-0.3.jar
D:\maven\.m2\repository\com\openhtmltopdf\openhtmltopdf-rtl-support\0.0.1-RC11\openhtmltopdf-rtl-support-0.0.1-RC11.jar
D:\maven\.m2\repository\com\ibm\icu\icu4j\58.1\icu4j-58.1.jar
D:\maven\.m2\repository\com\openhtmltopdf\openhtmltopdf-svg-support\0.0.1-RC11\openhtmltopdf-svg-support-0.0.1-RC11.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\batik-transcoder\1.8\batik-transcoder-1.8.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\batik-svggen\1.8\batik-svggen-1.8.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\xmlgraphics-commons\2.1\xmlgraphics-commons-2.1.jar
D:\maven\.m2\repository\commons-io\commons-io\1.3.1\commons-io-1.3.1.jar
D:\maven\.m2\repository\com\openhtmltopdf\openhtmltopdf-java2d\0.0.1-RC11\openhtmltopdf-java2d-0.0.1-RC11.jar
D:\maven\.m2\repository\com\vladsch\flexmark\flexmark\0.19.6\flexmark-0.19.6.jar
D:\maven\.m2\repository\com\vladsch\flexmark\flexmark-util\0.19.6\flexmark-util-0.19.6.jar
D:\maven\.m2\repository\com\vladsch\flexmark\flexmark-ext-anchorlink\0.19.6\flexmark-ext-anchorlink-0.19.6.jar
D:\maven\.m2\repository\com\vladsch\flexmark\flexmark-formatter\0.19.6\flexmark-formatter-0.19.6.jar
D:\maven\.m2\repository\com\vladsch\flexmark\flexmark-ext-toc\0.19.6\flexmark-ext-toc-0.19.6.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\batik-bridge\1.8\batik-bridge-1.8.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\batik-anim\1.8\batik-anim-1.8.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\batik-awt-util\1.8\batik-awt-util-1.8.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\batik-css\1.8\batik-css-1.8.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\batik-dom\1.8\batik-dom-1.8.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\batik-ext\1.8\batik-ext-1.8.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\batik-gvt\1.8\batik-gvt-1.8.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\batik-parser\1.8\batik-parser-1.8.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\batik-script\1.8\batik-script-1.8.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\batik-svg-dom\1.8\batik-svg-dom-1.8.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\batik-util\1.8\batik-util-1.8.jar
D:\maven\.m2\repository\org\apache\xmlgraphics\batik-xml\1.8\batik-xml-1.8.jar
D:\maven\.m2\repository\xalan\xalan\2.7.0\xalan-2.7.0.jar
D:\maven\.m2\repository\javax\activation\activation\1.1\activation-1.1.jar
D:\workPlace\ces\yitai-all-project\yitai-educational-api\target\classes
D:\workPlace\ces\yitai-all-project\yitai-educational-api\target\test-classes
D:\maven\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.6.2\jackson-core-2.6.2.jar
D:\maven\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.6.2\jackson-databind-2.6.2.jar
D:\maven\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.6.2\jackson-annotations-2.6.2.jar
D:\maven\.m2\repository\com\github\pagehelper\pagehelper\4.1.4\pagehelper-4.1.4.jar
D:\maven\.m2\repository\com\github\jsqlparser\jsqlparser\0.9.5\jsqlparser-0.9.5.jar
D:\maven\.m2\repository\org\apache\cxf\cxf-rt-rs-client\3.0.0\cxf-rt-rs-client-3.0.0.jar
D:\maven\.m2\repository\org\apache\cxf\cxf-core\3.0.0\cxf-core-3.0.0.jar
D:\maven\.m2\repository\org\codehaus\woodstox\woodstox-core-asl\4.3.0\woodstox-core-asl-4.3.0.jar
D:\maven\.m2\repository\org\apache\ws\xmlschema\xmlschema-core\2.1.0\xmlschema-core-2.1.0.jar
D:\maven\.m2\repository\org\apache\shiro\shiro-cas\1.2.3\shiro-cas-1.2.3.jar
D:\maven\.m2\repository\org\jasig\cas\client\cas-client-core\3.2.1\cas-client-core-3.2.1.jar
D:\maven\.m2\repository\commons-logging\commons-logging\1.1\commons-logging-1.1.jar
D:\maven\.m2\repository\org\springframework\data\spring-data-mongodb\1.8.2.RELEASE\spring-data-mongodb-1.8.2.RELEASE.jar
D:\maven\.m2\repository\org\springframework\data\spring-data-commons\1.11.2.RELEASE\spring-data-commons-1.11.2.RELEASE.jar
D:\maven\.m2\repository\org\mongodb\mongo-java-driver\2.11.1\mongo-java-driver-2.11.1.jar
D:\maven\.m2\repository\org\springframework\data\spring-data-redis\1.6.2.RELEASE\spring-data-redis-1.6.2.RELEASE.jar
D:\maven\.m2\repository\javax\servlet\servlet-api\2.5\servlet-api-2.5.jar
D:\maven\.m2\repository\jexcelapi\jxl\2.4.2\jxl-2.4.2.jar
D:\maven\.m2\repository\org\codehaus\jackson\jackson-jaxrs\1.9.2\jackson-jaxrs-1.9.2.jar
D:\maven\.m2\repository\org\codehaus\jackson\jackson-core-asl\1.9.2\jackson-core-asl-1.9.2.jar
D:\maven\.m2\repository\org\codehaus\jackson\jackson-mapper-asl\1.9.2\jackson-mapper-asl-1.9.2.jar
D:\maven\.m2\repository\org\codehaus\jackson\jackson-xc\1.9.2\jackson-xc-1.9.2.jar
D:\maven\.m2\repository\org\apache\cxf\cxf-rt-frontend-jaxws\3.1.7\cxf-rt-frontend-jaxws-3.1.7.jar
D:\maven\.m2\repository\xml-resolver\xml-resolver\1.2\xml-resolver-1.2.jar
D:\maven\.m2\repository\org\ow2\asm\asm\5.0.4\asm-5.0.4.jar
D:\maven\.m2\repository\org\apache\cxf\cxf-rt-bindings-soap\3.1.7\cxf-rt-bindings-soap-3.1.7.jar
D:\maven\.m2\repository\org\apache\cxf\cxf-rt-wsdl\3.1.7\cxf-rt-wsdl-3.1.7.jar
D:\maven\.m2\repository\org\apache\cxf\cxf-rt-databinding-jaxb\3.1.7\cxf-rt-databinding-jaxb-3.1.7.jar
D:\maven\.m2\repository\org\apache\cxf\cxf-rt-bindings-xml\3.1.7\cxf-rt-bindings-xml-3.1.7.jar
D:\maven\.m2\repository\org\apache\cxf\cxf-rt-frontend-simple\3.1.7\cxf-rt-frontend-simple-3.1.7.jar
D:\maven\.m2\repository\org\apache\cxf\cxf-rt-ws-addr\3.1.7\cxf-rt-ws-addr-3.1.7.jar
D:\maven\.m2\repository\org\apache\cxf\cxf-rt-ws-policy\3.1.7\cxf-rt-ws-policy-3.1.7.jar
D:\maven\.m2\repository\org\apache\neethi\neethi\3.0.3\neethi-3.0.3.jar
D:\maven\.m2\repository\org\apache\cxf\cxf-rt-transports-http\3.1.7\cxf-rt-transports-http-3.1.7.jar
D:\maven\.m2\repository\org\apache\cxf\cxf-rt-frontend-jaxrs\3.1.7\cxf-rt-frontend-jaxrs-3.1.7.jar
D:\maven\.m2\repository\javax\ws\rs\javax.ws.rs-api\2.0.1\javax.ws.rs-api-2.0.1.jar
D:\maven\.m2\repository\javax\annotation\javax.annotation-api\1.2\javax.annotation-api-1.2.jar
D:\maven\.m2\repository\org\apache\cxf\cxf-rt-rs-service-description\3.1.7\cxf-rt-rs-service-description-3.1.7.jar
D:\maven\.m2\repository\org\codehaus\woodstox\stax2-api\3.1.1\stax2-api-3.1.1.jar
D:\maven\.m2\repository\javax\xml\stream\stax-api\1.0-2\stax-api-1.0-2.jar
D:\maven\.m2\repository\wsdl4j\wsdl4j\1.6.2\wsdl4j-1.6.2.jar
D:\maven\.m2\repository\org\apache\httpcomponents\httpcore\4.3\httpcore-4.3.jar
D:\maven\.m2\repository\commons-fileupload\commons-fileupload\1.2.2\commons-fileupload-1.2.2.jar
D:\maven\.m2\repository\commons-io\commons-io\2.4\commons-io-2.4.jar
D:\maven\.m2\repository\commons-beanutils\commons-beanutils\1.8.3\commons-beanutils-1.8.3.jar
D:\maven\.m2\repository\commons-lang\commons-lang\2.6\commons-lang-2.6.jar
D:\maven\.m2\repository\org\apache\commons\commons-lang3\3.1\commons-lang3-3.1.jar
D:\maven\.m2\repository\commons-configuration\commons-configuration\1.9\commons-configuration-1.9.jar
D:\maven\.m2\repository\commons-validator\commons-validator\1.5.0\commons-validator-1.5.0.jar
D:\maven\.m2\repository\commons-digester\commons-digester\1.8.1\commons-digester-1.8.1.jar
D:\maven\.m2\repository\commons-collections\commons-collections\3.2.2\commons-collections-3.2.2.jar
D:\maven\.m2\repository\mysql\mysql-connector-java\5.1.38\mysql-connector-java-5.1.38.jar
D:\maven\.m2\repository\org\apache\tomcat\tomcat-jdbc\7.0.53\tomcat-jdbc-7.0.53.jar
D:\maven\.m2\repository\org\apache\tomcat\tomcat-juli\7.0.53\tomcat-juli-7.0.53.jar
D:\maven\.m2\repository\com\h2database\h2\1.3.167\h2-1.3.167.jar
D:\maven\.m2\repository\c3p0\c3p0\0.9.1.2\c3p0-0.9.1.2.jar
D:\maven\.m2\repository\com\alibaba\druid\1.0.18\druid-1.0.18.jar
D:\maven\.m2\repository\javax\inject\javax.inject\1\javax.inject-1.jar
D:\maven\.m2\repository\org\mybatis\mybatis\3.2.8\mybatis-3.2.8.jar
D:\maven\.m2\repository\org\mybatis\mybatis-spring\1.1.1\mybatis-spring-1.1.1.jar
D:\maven\.m2\repository\com\google\guava\guava\18.0\guava-18.0.jar
D:\maven\.m2\repository\cglib\cglib\2.2.2\cglib-2.2.2.jar
D:\maven\.m2\repository\asm\asm\3.3.1\asm-3.3.1.jar
D:\maven\.m2\repository\org\codehaus\groovy\groovy-backports-compat23\2.4.0-beta-3\groovy-backports-compat23-2.4.0-beta-3.jar
D:\maven\.m2\repository\ch\qos\logback\logback-classic\1.1.2\logback-classic-1.1.2.jar
D:\maven\.m2\repository\ch\qos\logback\logback-core\1.1.2\logback-core-1.1.2.jar
D:\maven\.m2\repository\org\slf4j\log4j-over-slf4j\1.7.7\log4j-over-slf4j-1.7.7.jar
D:\maven\.m2\repository\org\slf4j\jcl-over-slf4j\1.7.7\jcl-over-slf4j-1.7.7.jar
D:\maven\.m2\repository\org\slf4j\jul-to-slf4j\1.7.7\jul-to-slf4j-1.7.7.jar
D:\maven\.m2\repository\com\googlecode\log4jdbc\log4jdbc\1.2\log4jdbc-1.2.jar
D:\maven\.m2\repository\org\jasypt\jasypt\1.9.2\jasypt-1.9.2.jar
D:\maven\.m2\repository\com\google\code\gson\gson\2.2.3\gson-2.2.3.jar
D:\maven\.m2\repository\org\freemarker\freemarker\2.3.23\freemarker-2.3.23.jar
D:\maven\.m2\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar
D:\maven\.m2\repository\javax\el\el-api\2.2.1-b04\el-api-2.2.1-b04.jar
D:\maven\.m2\repository\javax\servlet\jsp\jsp-api\2.2.1-b03\jsp-api-2.2.1-b03.jar
D:\maven\.m2\repository\com\thoughtworks\xstream\xstream\1.4.7\xstream-1.4.7.jar
D:\maven\.m2\repository\xmlpull\xmlpull\1.1.3.1\xmlpull-1.1.3.1.jar
D:\maven\.m2\repository\xpp3\xpp3_min\1.1.4c\xpp3_min-1.1.4c.jar
D:\maven\.m2\repository\javax\servlet\jstl\1.1.2\jstl-1.1.2.jar
D:\maven\.m2\repository\taglibs\standard\1.1.2\standard-1.1.2.jar
D:\maven\.m2\repository\org\crazycake\shiro-redis\2.4.2.1-RELEASE\shiro-redis-2.4.2.1-RELEASE.jar
D:\maven\.m2\repository\javax\mail\mail\1.4.3\mail-1.4.3.jar
D:\maven\.m2\repository\com\esotericsoftware\kryo\kryo\2.24.0\kryo-2.24.0.jar
D:\maven\.m2\repository\com\esotericsoftware\minlog\minlog\1.2\minlog-1.2.jar
D:\maven\.m2\repository\org\objenesis\objenesis\2.1\objenesis-2.1.jar
D:\maven\.m2\repository\net\coobird\thumbnailator\0.4.7\thumbnailator-0.4.7.jar
D:\maven\.m2\repository\org\jsoup\jsoup\1.8.3\jsoup-1.8.3.jar
D:\maven\.m2\repository\org\dbunit\dbunit\2.4.8\dbunit-2.4.8.jar
D:\maven\.m2\repository\junit\junit\4.12-beta-3\junit-4.12-beta-3.jar
D:\maven\.m2\repository\org\apache\shiro\shiro-core\1.2.0\shiro-core-1.2.0.jar
D:\maven\.m2\repository\org\apache\shiro\shiro-web\1.2.0\shiro-web-1.2.0.jar
D:\maven\.m2\repository\org\apache\shiro\shiro-ehcache\1.2.0\shiro-ehcache-1.2.0.jar
D:\maven\.m2\repository\net\sf\ehcache\ehcache-core\2.5.0\ehcache-core-2.5.0.jar
D:\maven\.m2\repository\org\apache\shiro\shiro-spring\1.2.0\shiro-spring-1.2.0.jar
D:\maven\.m2\repository\org\apache\httpcomponents\httpmime\4.3.1\httpmime-4.3.1.jar
D:\maven\.m2\repository\org\mvel\mvel2\2.2.4.Final\mvel2-2.2.4.Final.jar
D:\maven\.m2\repository\org\codehaus\groovy\groovy-all\2.3.8\groovy-all-2.3.8.jar
D:\maven\.m2\repository\org\apache\commons\commons-compress\1.10\commons-compress-1.10.jar
D:\maven\.m2\repository\org\aspectj\aspectjweaver\1.8.8\aspectjweaver-1.8.8.jar
D:\maven\.m2\repository\org\quartz-scheduler\quartz\2.2.3\quartz-2.2.3.jar
D:\maven\.m2\repository\org\xeustechnologies\jcl-core\2.6\jcl-core-2.6.jar
D:\maven\.m2\repository\cglib\cglib-nodep\2.2\cglib-nodep-2.2.jar
D:\maven\.m2\repository\org\apache\poi\poi\3.11\poi-3.11.jar
D:\maven\.m2\repository\com\jhlabs\filters\2.0.235\filters-2.0.235.jar
D:\maven\.m2\repository\com\alibaba\dubbo\2.5.3\dubbo-2.5.3.jar
D:\maven\.m2\repository\org\javassist\javassist\3.15.0-GA\javassist-3.15.0-GA.jar
D:\maven\.m2\repository\org\jboss\netty\netty\3.2.5.Final\netty-3.2.5.Final.jar
D:\maven\.m2\repository\com\github\sgroschupf\zkclient\0.1\zkclient-0.1.jar
D:\maven\.m2\repository\log4j\log4j\1.2.14\log4j-1.2.14.jar
D:\maven\.m2\repository\org\jboss\resteasy\resteasy-jaxrs\3.0.7.Final\resteasy-jaxrs-3.0.7.Final.jar
D:\maven\.m2\repository\org\jboss\spec\javax\annotation\jboss-annotations-api_1.1_spec\1.0.1.Final\jboss-annotations-api_1.1_spec-1.0.1.Final.jar
D:\maven\.m2\repository\net\jcip\jcip-annotations\1.0\jcip-annotations-1.0.jar
D:\maven\.m2\repository\org\jboss\resteasy\resteasy-client\3.0.7.Final\resteasy-client-3.0.7.Final.jar
D:\maven\.m2\repository\javax\validation\validation-api\1.0.0.GA\validation-api-1.0.0.GA.jar
D:\maven\.m2\repository\org\hibernate\hibernate-validator\4.2.0.Final\hibernate-validator-4.2.0.Final.jar
D:\maven\.m2\repository\org\jboss\resteasy\resteasy-jackson-provider\3.0.7.Final\resteasy-jackson-provider-3.0.7.Final.jar
D:\maven\.m2\repository\org\jboss\resteasy\resteasy-jaxb-provider\3.0.7.Final\resteasy-jaxb-provider-3.0.7.Final.jar
D:\maven\.m2\repository\com\sun\xml\bind\jaxb-impl\2.2.7\jaxb-impl-2.2.7.jar
D:\maven\.m2\repository\com\sun\xml\bind\jaxb-core\2.2.7\jaxb-core-2.2.7.jar
D:\maven\.m2\repository\javax\xml\bind\jaxb-api\2.2.7\jaxb-api-2.2.7.jar
D:\maven\.m2\repository\com\sun\istack\istack-commons-runtime\2.16\istack-commons-runtime-2.16.jar
D:\maven\.m2\repository\com\sun\xml\fastinfoset\FastInfoset\1.2.12\FastInfoset-1.2.12.jar
D:\maven\.m2\repository\javax\xml\bind\jsr173_api\1.0\jsr173_api-1.0.jar
D:\maven\.m2\repository\org\jboss\resteasy\resteasy-netty\3.0.7.Final\resteasy-netty-3.0.7.Final.jar
D:\maven\.m2\repository\io\netty\netty\3.6.4.Final\netty-3.6.4.Final.jar
D:\maven\.m2\repository\org\jboss\resteasy\resteasy-jdk-http\3.0.7.Final\resteasy-jdk-http-3.0.7.Final.jar
D:\maven\.m2\repository\org\apache\tomcat\embed\tomcat-embed-core\8.0.11\tomcat-embed-core-8.0.11.jar
D:\maven\.m2\repository\org\apache\tomcat\embed\tomcat-embed-logging-juli\8.0.11\tomcat-embed-logging-juli-8.0.11.jar
D:\maven\.m2\repository\com\alibaba\fastjson\1.2.21\fastjson-1.2.21.jar
D:\maven\.m2\repository\com\xuxueli\xxl-job-core\1.5.1\xxl-job-core-1.5.1.jar
D:\maven\.m2\repository\org\eclipse\jetty\jetty-server\8.2.0.v20160908\jetty-server-8.2.0.v20160908.jar
D:\maven\.m2\repository\org\eclipse\jetty\orbit\javax.servlet\3.0.0.v201112011016\javax.servlet-3.0.0.v201112011016.jar
D:\maven\.m2\repository\org\eclipse\jetty\jetty-continuation\8.2.0.v20160908\jetty-continuation-8.2.0.v20160908.jar
D:\maven\.m2\repository\org\eclipse\jetty\jetty-http\8.2.0.v20160908\jetty-http-8.2.0.v20160908.jar
D:\maven\.m2\repository\org\eclipse\jetty\jetty-io\8.2.0.v20160908\jetty-io-8.2.0.v20160908.jar
D:\maven\.m2\repository\org\eclipse\jetty\jetty-util\8.2.0.v20160908\jetty-util-8.2.0.v20160908.jar
D:\maven\.m2\repository\javax\servlet\jsp\jsp-api\2.2\jsp-api-2.2.jar
/D:/eclipse/configuration/org.eclipse.osgi/362/0/.cp/
/D:/eclipse/configuration/org.eclipse.osgi/361/0/.cp/

第三步:排查哪里用的4.1.5

没找到好方法,根据加载的顺序查找

发现一个子项目隐士引用的4.1.5

改了,解决

第四步:把需要的jar的版本信息放到父pom文件里

方便、管理、排查问题

参考资料:

JAVA获取CLASSPATH路径

ClassLoader加载资源时的搜索路径

时间: 2024-10-08 08:16:58

Maven 多模块引用版本的问题 java.lang.NoSuchMethodError的相关文章

maven web 项目中启动报错java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener

本篇文章主要介绍了"maven web 项目中启动报错java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener ",主要涉及到maven web 项目中启动报错java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener 方面的内容,对于maven web 项目中启动报错jav

记一次netty版本冲突,报java.lang.NoSuchMethodError: io.netty.util.internal.ObjectUtil.checkPositive的问题

elasticsearch 5.6中使用TransportClient初始化抛异常 在引入elasticsearch5.6的transportclient包中,会引入netty进行通信. <!-- transport客户端 --> <dependency> <groupId>org.elasticsearch.client</groupId> <artifactId>transport</artifactId> <version

[maven 问题]java.lang.NoSuchMethodError: javax.ws.rs.core.Application.getProperties()Ljava/util/Map

NotifyService站点今天maven build的时候出现如下异常 WARNING] FAILED org.eclipse.jetty.maven.plugin.JettyServer@3c64339f: java.lang.NoSuchMethodError: javax.ws.rs.core.Application.getProperties()Ljava/util/Map; java.lang.NoSuchMethodError: javax.ws.rs.core.Applicat

使用selenium遇到java.lang.NoSuchMethodError: org.apache.xpath.XPathContext,排查

处试selenium webdriver,运行小程序,抛如下错误: java.lang.NoSuchMethodError: org.apache.xpath.XPathContext.<init>(Z)V at org.apache.xpath.jaxp.XPathExpressionImpl.eval(XPathExpressionImpl.java:115) at org.apache.xpath.jaxp.XPathExpressionImpl.eval(XPathExpression

java.lang.NoSuchMethodError的通用解决思路

NoSuchMethodError中文意思是没有找到方法,遇到这个错误并不是说依赖的jar包.方法不存在而找不到,这就类似于 ClassNotFoundException错误了,出现ClassNotFoundException错误也不一定是缺少依赖的jar.class,有可能是依赖的冲突,即引用了多次报错Class的jar. 那么同样道理,NoSuchMethodError出现经常是因为报错的这个方法的类的jar包产生了冲突. 明白了为什么会出现这个错误后,我们再去解决这个错误.一般情况下,手动

Hibernate常见错误:java.lang.NoSuchMethodError: org.hibernate.SessionFactory.openSession()Lorg/hibe

hibernate4 与 spring3有点冲突 http://blog.csdn.net/gyflyx/article/details/7632645 整合NoSuchMethodError错误 and 升级Spring3.1RC2 和Hibernate4.0.0CR7遇到的一些问题及解决 2012-02-20 10:33:28|  分类: 编程_SSH |字号 订阅 我使用的是hibernate4和spring3,然后报的错误是 java.lang.NoSuchMethodError: or

Spring Boot常见问题(二)Unable to start embedded container; nested exception is java.lang.NoSuchMethodError: org.apache.tomcat.util.scan.StandardJarScanner.setJarScanFilter(Lorg/apache/tomcat/JarScanFilter;

问题描述:通过Spring Boot官方提供的方式,写出如下HelloWorld代码. @Controller @EnableAutoConfiguration public class HelloWorld { @RequestMapping("/wu") @ResponseBody String home() { return "Hello World!"; } public static void main(String[] args) throws Exce

Junit测试出现异常:Exception in thread &quot;main&quot; java.lang.NoSuchMethodError: org.junit.platform.commons.util.

在进行单元测试时,测试出现异常 Exception in thread "main" java.lang.NoSuchMethodError: org.junit.platform.commons.util.ReflectionUtils.getDefaultClassLoader()Ljava/lang/ClassLoader; 错误就在pom.xml的依赖中,仔细查看控制台输出你会发现IntelliJ IDEA正在尝试使用JUnit5运行我的测试用例. at com.intelli

java.lang.NoSuchMethodError: org.apache.poi.hssf.usermodel.HSSFSheet.getMergedRegion

java.lang.reflect.InvocationTargetException.  Coused by : java.lang.NoSuchMethodError:这个异常是找不到方法,但是如果编译时不出错,而在运行时出错,那么一般是因为找不到包.而找不到包的原因有三种原因:一种是JAR包未导入.第二种原因是:其实包是有的,但是版本不对.第三种原因是:jar包全都放到lib下了,但是引用时包冲突. 对于第二.三中原因:在用到该方法的方法下打印下面这句代码,用以确定包的具体路径.然后反编译