Je travaille actuellement sur une application Spring sur Tomcat7, JDK1.7, Maven et d'autres composants. Récemment, j'ai apporté un changement majeur à l'application, nécessitant le passage à Spring 3. Après le changement, je vois l'exception ci-dessous lors du déploiement sur un serveur de développement. L'application fonctionne parfaitement sur mon système local cependant.
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)
Je ne pense pas qu'il y ait de problème avec le code XML amadeusAce-servlet.xml
également, car le fichier n'a pas changé depuis le dernier déploiement.
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>
Tout ce que vous pouvez voir à partir des ressources ci-dessus? J'aimerais absolument avoir de vos nouvelles. Je vous remercie.
MODIFIER:
Comme suggéré dans le post ci-dessous, j'ai découvert le chemin de classe à partir duquel les dépendances sont résolues. Résultats ci-dessous:
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
Java.lang.NoSuchMethodError
se produit s'il y a un problème avec le fichier jar chargé. Je pense que sur le système sur lequel vous essayez d’exécuter ce code, aCLASSPATHdéfini sur un chemin qui est loading the older version of the jar
. Utilisez le code suivant pour connaître les chemins à partir desquels le ClassLoader résout les dépendances.
public static void main(String[] args) {
URLClassLoader classLoader = (URLClassLoader)Main.class.getClassLoader();
System.out.println(Arrays.toString(classLoader.getURLs()));
}
Placez cette méthode dans la classe Main et exécutez-la dans le système à l'origine de cette erreur. Il vous montrera tous les chemins à partir desquels les dépendances ont été résolues. Découvrez si l'un des chemins contient une version plus ancienne du pot.
J'espère que cela aide votre cause.
J'ai rencontré le même problème, obtenant l'exception ci-dessous tout en essayant d'exécuter mon travail via MyEclipse IDE. Causée par: Java.lang.NoSuchMethodError: org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.getEnvironment () Lorg/springframework/core/env/Enviroment;
Après avoir supprimé les fichiers jar Spring2 par défaut du chemin de génération Java, tout fonctionnait correctement.
Ce qui a résolu l’erreur, c’est d’ajouter à chaque printemps xml de mon projet la version des haricots de printemps. Par exemple:
<?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>
au lieu de
<?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>
J'ai aussi eu le même problème. Le problème était org.Apache.cxf version définie en tant que 2.2.3.Parce que même org.springframework version définie en tant que 4.0.0.RELEASE maven a téléchargé la version 2.x de org.springframework.En raison de cette J'ai eu la même erreur. Après avoir changé la version de org.Apache.cxf en 2.7.x et en supprimant tous les sping2.x from.m2, l’erreur avait disparu.