Spring MVC - NoSuchMethodError异常 - Tomcat7

时间:2014-11-07 22:16:42

标签: java maven spring-mvc tomcat7 pom.xml

我的maven项目使用spring mvc。我得到no such method error。我相信它是由于依赖版本中的一些冲突,但我确实拥有相同版本的所有依赖项。构建成功,但tomcat引发以下异常:

NoSuchMethodError: org.springframework.core.convert.converter.ConverterRegistry.addConverter

请介绍如何解决以下错误。

以下是pom.xml文件。

      <?xml version="1.0" encoding="UTF-8"?>
     <modelVersion>4.0.0</modelVersion>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>3.1.2.RELEASE</version>
    </dependency>

        <!-- <exclusions>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
            </exclusion>
        </exclusions> -->




    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-tx</artifactId>
        <version>3.1.0.RELEASE</version>
     </dependency> 

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>3.1.0.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>3.1.0.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aop</artifactId>
        <version>3.1.0.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-asm</artifactId>
        <version>3.1.0.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>3.1.0.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context-support</artifactId>
        <version>3.1.0.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</artifactId>
        <version>3.1.0.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-expression</artifactId>
        <version>3.1.0.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
        <version>3.1.0.RELEASE</version>
    </dependency>




    <dependency>
        <groupId>xerces</groupId>
        <artifactId>xercesImpl</artifactId>
        <version>2.8.1</version>
    </dependency>



</dependencies>

<properties>
    <spring3.version>3.2.3.RELEASE</spring3.version>
    <jersey.version>2.1</jersey.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <timestamp>${maven.build.timestamp}</timestamp>
</properties>
    <build>
    <finalName>ape</finalName>
    <resources>
        <resource>
            <directory>src/main/resources</directory>
            <filtering>true</filtering>
        </resource>
    </resources>

   <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
            <inherited>true</inherited>
            <configuration>
              <source>1.7</source>
              <target>1.7</target>
             </configuration>
     </plugin>

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.2.1</version>
            <configuration>
                <mainClass>org.test.int1.Main</mainClass>
            </configuration>
        </plugin>

    </plugins>
</build>
 <build>
    <plugins>
        <plugin>
            <groupId>com.sun.istack</groupId>
            <artifactId>maven-istack-commons-plugin</artifactId>
            <inherited>true</inherited>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <inherited>true</inherited>
        </plugin>
    </plugins>
</build>

0 个答案:

没有答案