java.lang.NoSuchMethodError:org.springframework.be

2019-08-03 09:01发布

我正在上Tomcat7,JDK1.7,Maven和其它组件的Spring应用程序。 最近,我对应用程序的一次重大变革,需要切换到春天3.更改后,我看到在部署到开发服务器下面的例外。 该应用程序完美运行我的本地系统上虽然。

javax.servlet.ServletException: Servlet.init() for servlet amadeusAce threw exception
    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
    org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
    org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    java.lang.Thread.run(Thread.java:722)
root cause

org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/amadeusAce-servlet.xml]; nested exception is java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.XmlReaderContext.getResourceLoader()Lorg/springframework/core/io/ResourceLoader;
    org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:375)
    org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
    org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:280)
    org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:131)
    org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:147)
    org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
    org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)
    org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:100)
    org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:298)
    org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:311)
    org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:258)
    org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:229)
    org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:115)
    javax.servlet.GenericServlet.init(GenericServlet.java:160)
    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
    org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
    org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    java.lang.Thread.run(Thread.java:722)
root cause

java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.XmlReaderContext.getResourceLoader()Lorg/springframework/core/io/ResourceLoader;
    org.springframework.context.annotation.ComponentScanBeanDefinitionParser.configureScanner(ComponentScanBeanDefinitionParser.java:100)
    org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:83)
    org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:69)
    org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1114)
    org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1104)
    org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:133)
    org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:90)
    org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:458)
    org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:353)
    org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
    org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:280)
    org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:131)
    org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:147)
    org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)
    org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)
    org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:100)
    org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:298)
    org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:311)
    org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:258)
    org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:229)
    org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:115)
    javax.servlet.GenericServlet.init(GenericServlet.java:160)
    org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
    org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
    org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
    org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    java.lang.Thread.run(Thread.java:722)

我不认为有与所述XML的任何问题amadeusAce-servlet.xml以及因为有自去年部署在文件中没有变化。

的pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.ace.amadeus</groupId>
    <artifactId>AmadeusSpring</artifactId>
    <version>1.0.0</version>
    <packaging>war</packaging>
    <name>Simple CXF project using spring configuration</name>
    <repositories>
        <repository>
            <id>JBoss repository</id>
            <url>https://repository.jboss.org/nexus/content/repositories/deprecated/</url>
        </repository>
        <repository>
            <id>maven2-repository.dev.java.net</id>
            <name>Java.net Repository for Maven</name>
            <url>http://download.java.net/maven/2/</url>
            <layout>default</layout>
        </repository>
        <repository>
            <id>java.net2</id>
            <name>Java.net</name>
            <url>https://oss.sonatype.org/content/repositories/java.net2</url>
        </repository>
    </repositories>
    <dependencies>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.2.2</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>jsr311-api</artifactId>
            <version>0.2</version>
        </dependency>
        <dependency>
            <groupId>com.sun.jersey</groupId>
            <artifactId>jersey-server</artifactId>
            <version>1.8</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxws</artifactId>
            <version>2.1.3</version>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http</artifactId>
            <version>2.1.3</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>3.0.5.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>3.0.5.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-ibatis</artifactId>
            <version>2.0.8</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
            <version>3.0.5.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aspects</artifactId>
            <version>3.0.5.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>3.0.5.RELEASE</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springmodules</groupId>
            <artifactId>spring-modules-validation</artifactId>
            <version>0.8a</version>
        </dependency>
        <dependency>
            <groupId>org.apache.tiles</groupId>
            <artifactId>tiles-jsp</artifactId>
            <version>2.0.7</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.4</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.1.2</version>
        </dependency>
        <dependency>
            <groupId>taglibs</groupId>
            <artifactId>standard</artifactId>
            <version>1.1.2</version>
        </dependency>
        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
            <version>20030825.184428</version>
        </dependency>
        <dependency>
            <groupId>commons-pool</groupId>
            <artifactId>commons-pool</artifactId>
            <version>20030825.183949</version>
        </dependency>
        <dependency>
            <groupId>org.apache.ibatis</groupId>
            <artifactId>ibatis-sqlmap</artifactId>
            <version>2.3.4.726</version>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.6</version>
        </dependency>
        <dependency>
            <groupId>uk.com.robust-it</groupId>
            <artifactId>cloning</artifactId>
            <version>1.8.2</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.4</version>
        </dependency>
        <dependency>
            <groupId>sax</groupId>
            <artifactId>sax</artifactId>
            <version>2.0.1</version>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

任何你可以从上面看到的资源? 我绝对喜欢听到你的声音。 谢谢。

编辑:
正如下面的建议后,我发现从那里依赖性解决类路径。 结果如下:

file:/D:/ace-amadeus-ws/AmadeusSpring/target/classes/
file:/C:/Users/pc/.m2/repository/org/apache/httpcomponents/httpclient/4.2.2/httpclient-4.2.2.jar
file:/C:/Users/pc/.m2/repository/org/apache/httpcomponents/httpcore/4.2.2/httpcore-4.2.2.jar
file:/C:/Users/pc/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar
file:/C:/Users/pc/.m2/repository/commons-codec/commons-codec/1.6/commons-codec-1.6.jar
file:/C:/Users/pc/.m2/repository/javax/ws/rs/jsr311-api/0.2/jsr311-api-0.2.jar
file:/C:/Users/pc/.m2/repository/com/sun/jersey/jersey-server/1.8/jersey-server-1.8.jar
file:/C:/Users/pc/.m2/repository/org/apache/cxf/cxf-rt-frontend-jaxws/2.1.3/cxf-rt-frontend-jaxws-2.1.3.jar
file:/C:/Users/pc/.m2/repository/org/apache/geronimo/specs/geronimo-jaxws_2.1_spec/1.0/geronimo-jaxws_2.1_spec-1.0.jar
file:/C:/Users/pc/.m2/repository/org/apache/geronimo/specs/geronimo-activation_1.1_spec/1.0.2/geronimo-activation_1.1_spec-1.0.2.jar
file:/C:/Users/pc/.m2/repository/asm/asm/2.2.3/asm-2.2.3.jar
file:/C:/Users/pc/.m2/repository/org/apache/cxf/cxf-api/2.1.3/cxf-api-2.1.3.jar
file:/C:/Users/pc/.m2/repository/org/apache/cxf/cxf-common-utilities/2.1.3/cxf-common-utilities-2.1.3.jar
file:/C:/Users/pc/.m2/repository/org/apache/geronimo/specs/geronimo-stax-api_1.0_spec/1.0.1/geronimo-stax-api_1.0_spec-1.0.1.jar
file:/C:/Users/pc/.m2/repository/wsdl4j/wsdl4j/1.6.2/wsdl4j-1.6.2.jar
file:/C:/Users/pc/.m2/repository/xml-resolver/xml-resolver/1.2/xml-resolver-1.2.jar
file:/C:/Users/pc/.m2/repository/org/apache/ws/commons/schema/XmlSchema/1.4.2/XmlSchema-1.4.2.jar
file:/C:/Users/pc/.m2/repository/org/apache/geronimo/specs/geronimo-annotation_1.0_spec/1.1.1/geronimo-annotation_1.0_spec-1.1.1.jar
file:/C:/Users/pc/.m2/repository/org/codehaus/woodstox/wstx-asl/3.2.6/wstx-asl-3.2.6.jar
file:/C:/Users/pc/.m2/repository/org/apache/neethi/neethi/2.0.4/neethi-2.0.4.jar
file:/C:/Users/pc/.m2/repository/org/apache/cxf/cxf-common-schemas/2.1.3/cxf-common-schemas-2.1.3.jar
file:/C:/Users/pc/.m2/repository/org/apache/cxf/cxf-rt-core/2.1.3/cxf-rt-core-2.1.3.jar
file:/C:/Users/pc/.m2/repository/com/sun/xml/bind/jaxb-impl/2.1.7/jaxb-impl-2.1.7.jar
file:/C:/Users/pc/.m2/repository/org/apache/geronimo/specs/geronimo-javamail_1.4_spec/1.3/geronimo-javamail_1.4_spec-1.3.jar
file:/C:/Users/pc/.m2/repository/com/sun/xml/fastinfoset/FastInfoset/1.2.2/FastInfoset-1.2.2.jar
file:/C:/Users/pc/.m2/repository/org/apache/cxf/cxf-rt-bindings-soap/2.1.3/cxf-rt-bindings-soap-2.1.3.jar
file:/C:/Users/pc/.m2/repository/org/apache/cxf/cxf-tools-common/2.1.3/cxf-tools-common-2.1.3.jar
file:/C:/Users/pc/.m2/repository/org/apache/velocity/velocity/1.5/velocity-1.5.jar
file:/C:/Users/pc/.m2/repository/com/sun/xml/bind/jaxb-xjc/2.1.7/jaxb-xjc-2.1.7.jar
file:/C:/Users/pc/.m2/repository/org/apache/geronimo/specs/geronimo-ws-metadata_2.0_spec/1.1.2/geronimo-ws-metadata_2.0_spec-1.1.2.jar
file:/C:/Users/pc/.m2/repository/org/apache/cxf/cxf-rt-databinding-jaxb/2.1.3/cxf-rt-databinding-jaxb-2.1.3.jar
file:/C:/Users/pc/.m2/repository/javax/xml/bind/jaxb-api/2.1/jaxb-api-2.1.jar
file:/C:/Users/pc/.m2/repository/org/apache/cxf/cxf-rt-bindings-xml/2.1.3/cxf-rt-bindings-xml-2.1.3.jar
file:/C:/Users/pc/.m2/repository/org/apache/cxf/cxf-rt-frontend-simple/2.1.3/cxf-rt-frontend-simple-2.1.3.jar
file:/C:/Users/pc/.m2/repository/org/apache/cxf/cxf-rt-ws-addr/2.1.3/cxf-rt-ws-addr-2.1.3.jar
file:/C:/Users/pc/.m2/repository/javax/xml/soap/saaj-api/1.3/saaj-api-1.3.jar
file:/C:/Users/pc/.m2/repository/com/sun/xml/messaging/saaj/saaj-impl/1.3.2/saaj-impl-1.3.2.jar
file:/C:/Users/pc/.m2/repository/org/apache/cxf/cxf-rt-transports-http/2.1.3/cxf-rt-transports-http-2.1.3.jar
file:/C:/Users/pc/.m2/repository/org/springframework/spring-web/3.0.5.RELEASE/spring-web-3.0.5.RELEASE.jar
file:/C:/Users/pc/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar
file:/C:/Users/pc/.m2/repository/org/springframework/spring-beans/3.0.5.RELEASE/spring-beans-3.0.5.RELEASE.jar
file:/C:/Users/pc/.m2/repository/org/springframework/spring-context/3.0.5.RELEASE/spring-context-3.0.5.RELEASE.jar
file:/C:/Users/pc/.m2/repository/org/springframework/spring-core/3.0.5.RELEASE/spring-core-3.0.5.RELEASE.jar
file:/C:/Users/pc/.m2/repository/org/springframework/spring-webmvc/3.0.5.RELEASE/spring-webmvc-3.0.5.RELEASE.jar
file:/C:/Users/pc/.m2/repository/org/springframework/spring-asm/3.0.5.RELEASE/spring-asm-3.0.5.RELEASE.jar
file:/C:/Users/pc/.m2/repository/org/springframework/spring-context-support/3.0.5.RELEASE/spring-context-support-3.0.5.RELEASE.jar
file:/C:/Users/pc/.m2/repository/org/springframework/spring-expression/3.0.5.RELEASE/spring-expression-3.0.5.RELEASE.jar
file:/C:/Users/pc/.m2/repository/org/springframework/spring-ibatis/2.0.8/spring-ibatis-2.0.8.jar
file:/C:/Users/pc/.m2/repository/org/springframework/spring-dao/2.0.8/spring-dao-2.0.8.jar
file:/C:/Users/pc/.m2/repository/org/springframework/spring-jdbc/2.0.8/spring-jdbc-2.0.8.jar
file:/C:/Users/pc/.m2/repository/org/springframework/spring-aop/3.0.5.RELEASE/spring-aop-3.0.5.RELEASE.jar
file:/C:/Users/pc/.m2/repository/org/springframework/spring-aspects/3.0.5.RELEASE/spring-aspects-3.0.5.RELEASE.jar
file:/C:/Users/pc/.m2/repository/org/springmodules/spring-modules-validation/0.8a/spring-modules-validation-0.8a.jar
file:/C:/Users/pc/.m2/repository/commons-lang/commons-lang/2.2/commons-lang-2.2.jar
file:/C:/Users/pc/.m2/repository/commons-collections/commons-collections/3.1/commons-collections-3.1.jar
file:/C:/Users/pc/.m2/repository/commons-validator/commons-validator/1.3.0/commons-validator-1.3.0.jar
file:/C:/Users/pc/.m2/repository/oro/oro/2.0.8/oro-2.0.8.jar
file:/C:/Users/pc/.m2/repository/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar
file:/C:/Users/pc/.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar
file:/C:/Users/pc/.m2/repository/commons-digester/commons-digester/1.7/commons-digester-1.7.jar
file:/C:/Users/pc/.m2/repository/antlr/antlr/2.7.6/antlr-2.7.6.jar
file:/C:/Users/pc/.m2/repository/org/springframework/spring/2.0.3/spring-2.0.3.jar
file:/C:/Users/pc/.m2/repository/rhino/js/1.6R2/js-1.6R2.jar
file:/C:/Users/pc/.m2/repository/org/apache/tiles/tiles-jsp/2.0.7/tiles-jsp-2.0.7.jar
file:/C:/Users/pc/.m2/repository/org/apache/tiles/tiles-core/2.0.7/tiles-core-2.0.7.jar
file:/C:/Users/pc/.m2/repository/org/apache/tiles/tiles-api/2.0.7/tiles-api-2.0.7.jar
file:/C:/Users/pc/.m2/repository/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar
file:/C:/Users/pc/.m2/repository/javax/servlet/servlet-api/2.4/servlet-api-2.4.jar
file:/C:/Users/pc/.m2/repository/javax/servlet/jstl/1.1.2/jstl-1.1.2.jar
file:/C:/Users/pc/.m2/repository/taglibs/standard/1.1.2/standard-1.1.2.jar
file:/C:/Users/pc/.m2/repository/commons-dbcp/commons-dbcp/20030825.184428/commons-dbcp-20030825.184428.jar
file:/C:/Users/pc/.m2/repository/commons-pool/commons-pool/20030825.183949/commons-pool-20030825.183949.jar
file:/C:/Users/pc/.m2/repository/org/apache/ibatis/ibatis-sqlmap/2.3.4.726/ibatis-sqlmap-2.3.4.726.jar
file:/C:/Users/pc/.m2/repository/mysql/mysql-connector-java/5.1.6/mysql-connector-java-5.1.6.jar
file:/C:/Users/pc/.m2/repository/uk/com/robust-it/cloning/1.8.2/cloning-1.8.2.jar
file:/C:/Users/pc/.m2/repository/org/objenesis/objenesis/1.2/objenesis-1.2.jar
file:/C:/Users/pc/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar
file:/C:/Users/pc/.m2/repository/sax/sax/2.0.1/sax-2.0.1.jar

Answer 1:

java.lang.NoSuchMethodError如果有一些问题与加载的罐子发生。 我认为你正试图运行该代码的系统中,有CLASSPATH设置为其中一些是路径loading the older version of the jar 。 使用下面的代码,找出从哪里ClassLoader是解决依赖的路径

public static void main(String[] args) {
            URLClassLoader classLoader = (URLClassLoader)Main.class.getClassLoader();
            System.out.println(Arrays.toString(classLoader.getURLs()));
    }

把这种方法的主要类和正在给这个错误时,系统执行。 它会告诉你一切从那里的依赖性已得到解决的路径。 找出任何路径有罐子的旧版本。

希望这有助于你的事业。



Answer 2:

我面临着同样的问题,得到了下面的异常试图运行通过MyEclipse的IDE我的工作。 java.lang.NoSuchMethodError:通过引起org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.getEnvironment()Lorg / springframework的/核心/ env的/环境;

除去Java构建路径默认Spring2罐后,这是工作的罚款。



Answer 3:

我也有同样的问题。 问题是org.apache.cxf定义为,即使org.springframework的版本2.2.3.Because定义为4.0.0.RELEASE行家下载的这个org.springframework的2.x的version.Because我得到了同样的error.After改变在org.apache.cxf版本2.7.x和删除所有sping2.x from.m2错误不见了。



Answer 4:

解决了什么错误,我是在每年春季XML加在我的项目弹簧豆的版本。 例如:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd">

    <!-- spring stuff here -->
</beans>

代替

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
    <!-- spring stuff here -->
</beans>


文章来源: java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.XmlReaderContext.getResourceLoader()Lorg/springframework/core/io/ResourceLoader