web-dev-qa-db-ja.com

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

私はTomcat7、JDK1.7、Mavenおよびその他のコンポーネントでSpringアプリケーションに取り組んでいます。最近、アプリケーションに大きな変更を加え、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
10
James

Java.lang.NoSuchMethodErrorは、ロードされたjarに問題がある場合に発生します。このコードを実行しようとしているシステムでは、[〜#〜] 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()));
    }

このメソッドをMainクラスに配置し、このエラーが発生しているシステムで実行します。依存関係が解決された場所からのすべてのパスが表示されます。パスのいずれかに古いバージョンのjarが含まれているかどうかを確認します。

これがあなたの大義に役立つことを願っています。

10
Narendra Pathai

MyEclipse IDEでジョブを実行しようとすると、同じ問題が発生し、以下の例外が発生しました。 原因:Java.lang.NoSuchMethodError:org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.getEnvironment()Lorg/springframework/core/env/Environment;

デフォルトのSpring2jarをJavaビルドパスから削除した後、正常に機能していました。

1
Arun

私にとってエラーを解決したのは、プロジェクトの各Springxmlにspring-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-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>
0
olNoy

私も同じ問題を抱えていました。問題はorg.Apache.cxf'sバージョンが2.2.3として定義されていたためですorg.springframework'sバージョンが4.0.0として定義されています。 xバージョン。このため、同じエラーが発生しました。org.Apache.cxfバージョンを2.7.xに変更し、すべてのsping2.xを.m2から削除すると、エラーはなくなりました。

0
GPrathap