Arun Kumar
Arun Kumar

Reputation: 6794

java.lang.NoSuchMethodError: org.springframework.web.method.support.HandlerMethodArgumentResolverComposite

I am building an spring restful project where i was applying spring security of digest authentication, I have upgraded versions of spring dependencies from 3.0.4 to 3.1 and hence i am encountering the following error: java.lang.NoSuchMethodError:org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.addResolvers(Ljava/util/List;)Lorg/springframework/web/method/supportHandlerMethodArgumentResolverComposite;

I had to upgrade to new version of spring to 3.1 to use its security prospects. Kindly help me solve this problem.

Also below are the dependencies in my pom.xml of spring framework:

<dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.5</version>
        </dependency>

        <dependency>
            <groupId>taglibs</groupId>
            <artifactId>standard</artifactId>
            <version>1.1.2</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${spring.version}</version>
            <type>pom</type>
            <scope>compile</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
            <version>${spring.version}</version>
            <type>pom</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.version}</version>
            <type>pom</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring.version}</version>
            <type>pom</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
            <type>pom</type>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-acl</artifactId>
            <version>${spring-security.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>${spring.version}</version>
        </dependency>


        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring.version}</version>

            <scope>compile</scope>
        </dependency>
        <!-- Spring Dependencies End -->

<!-- Springs security dependency start -->

spring security dependencies start

            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <version>3.0.3.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>3.0.3.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <version>3.0.3.RELEASE</version>
        </dependency>
        <!-- Springs security dependency end -->

Upvotes: 1

Views: 8067

Answers (1)

Aravind A
Aravind A

Reputation: 9697

I suspect that both the older and latest library is in your classpath . Check the .classpath file and do a mvn clean eclipse:eclipse , clean the project, refresh and test.

Upvotes: 5

Related Questions