Spring MVC - Why a NoSuchMethodError exception when deploying a context?

Despite the fact that this project worked for me for a while, now I get an exception when I try to deploy my application context to Tomcat:

Servlet /testapp threw load() exception
java.lang.NoSuchMethodError: org.springframework.core.convert.converter.ConverterRegistry.addConverter(Ljava/lang/Class;Ljava/lang/Class;Lorg/springframework/core/convert/converter/Converter;)V
    at org.springframework.core.convert.support.DefaultConversionService.addScalarConverters(DefaultConversionService.java:62)

From what I read, this can happen if several versions of Spring are built in the application. However, I completely cleaned up my local dependency repository to confirm that I only have the version that I want in my build path. My dependencies are as follows:

<properties>
    <java-version>1.6</java-version>
    <org.springframework.version>3.1.0.RELEASE</org.springframework.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  </properties>

  <dependencies>
    <!-- CGLIB, only required and used for @Configuration usage -->
    <dependency>
        <groupId>cglib</groupId>
        <artifactId>cglib-nodep</artifactId>
        <version>2.2.2</version>
    </dependency>
    <!-- Test -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.10</version>
        <scope>test</scope>
    </dependency>
    <!-- @Inject -->
    <dependency>
        <groupId>javax.inject</groupId>
        <artifactId>javax.inject</artifactId>
        <version>1</version>
    </dependency>

    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-core-asl</artifactId>
        <version>1.9.4</version>
    </dependency>
    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-mapper-asl</artifactId>
        <version>1.9.4</version>
    </dependency>

    <dependency>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-eclipse-plugin</artifactId>
        <version>2.8</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>${org.springframework.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>${org.springframework.version}</version>
        <optional>false</optional>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet.jsp</groupId>
        <artifactId>jsp-api</artifactId>
        <version>2.1</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>
  </dependencies>

I have no compiler errors in the Eclipse project, and it works great, with no warnings or errors. However, Tomcat notes that my only test servlet is not available, and when I finish the logs, the above stacktrace is my only hint.

, , . Spring Spring MVC , , , .

+5
2

@nickdos , . pom.xml, , , . , , "" .

Spring v3.x, Spring 2.5, . , :

<dependency>
    <groupId>com.sun.jersey</groupId>
    <artifactId>jersey-server</artifactId>
    <version>${com.sun.jersey.version}</version>
</dependency>
<dependency>
    <groupId>com.sun.jersey</groupId>
    <artifactId>jersey-client</artifactId>
    <version>${com.sun.jersey.version}</version>
</dependency>
<dependency>
    <groupId>com.sun.jersey</groupId>
    <artifactId>jersey-json</artifactId>
    <version>${com.sun.jersey.version}</version>
</dependency>
<dependency>
    <groupId>com.sun.jersey.contribs</groupId>
    <artifactId>jersey-spring</artifactId>
    <version>${com.sun.jersey.version}</version>
    <exclusions>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
        </exclusion>
        <exclusion>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </exclusion>
    </exclusions>
</dependency>

@nickdos , , , Spring MVC, REST load() .

!

+2

'methodValidationPostProcessor', . : org.springframework.beans.factory.BeanCreationException: 'grationEvaluationContext '. : org.springframework.beans.BeanInstantiationException: .springframework.integration.config.IntegrationEvaluationContextFactoryBean] : java.lang.NoSuchMethodError: org.springframework.core.convert.support.DefaultConversionService.getSharedInstance() Conversion/corework/ org.springframework.expression.spel.support.StandardTypeConverter. (StandardTypeConverter.java:46) ~ [spring-expression-4.3.12.RELEASE.jar: 4.3.12.RELEASE]

1.5.8 Release. ?

0

All Articles