0


アプリケーションの spring security のバージョンを 3.2.0.M1 から 3.1.3 に変更しましたが、Tomcat がアプリケーションを起動するとエラーが発生します。例外スタックの最初の行は次のとおりです。

2013-04-25 11:33:12,893 [localhost-startStop-1] ERROR org.springframework.web.context.ContextLoader - org.springframework.web.context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [C:\Users\daniele\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\Ice-Cream-Webapp\WEB-INF\classes\com\myprj\app\web\controller\FrontPagesController.class]; nested exception is java.lang.IncompatibleClassChangeError: class org.springframework.core.type.classreading.ClassMetadataReadingVisitor has interface org.springframework.asm.ClassVisitor as super class

そして私の 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.company</groupId>
<artifactId>myprj-Webapp</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>

<name>myprj-Webapp</name>
<url>http://www.company.com</url>

<properties>
    <org.springframework.version>3.2.2.RELEASE</org.springframework.version>
    <org.springframework.test.version>3.2.2.RELEASE</org.springframework.test.version>
    <org.springframework.security.version>3.1.3.RELEASE</org.springframework.security.version>
    <org.springframework.security.oauth.version>1.0.2.RELEASE</org.springframework.security.oauth.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>


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

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

    <dependency>
        <groupId>jstl</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.security.oauth</groupId>
        <artifactId>spring-security-oauth2</artifactId>
        <version>${org.springframework.security.oauth.version}</version>
    </dependency>

    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.17</version>
    </dependency>

    <dependency>
        <groupId>net.sourceforge.findbugs</groupId>
        <artifactId>annotations</artifactId>
        <version>1.3.2</version>
    </dependency>

    <dependency>
        <groupId>org.apache.tomcat</groupId>
        <artifactId>tomcat-servlet-api</artifactId>
        <version>7.0.34</version>
        <scope>provided</scope>
    </dependency>

    <!-- Test dependencies -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-test</artifactId>
        <version>${org.springframework.test.version}</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.10</version>
        <scope>test</scope>
    </dependency>
</dependencies>

<repositories>
    <repository>
        <id>org.springframework.maven.milestone</id>
        <name>Spring Maven Milestone Repository</name>
        <url>http://maven.springframework.org/milestone</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>

<build>
    <finalName>myprj-Webapp</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>
            <version>2.3.2</version>
            <configuration>
                <source>1.7</source>
                <target>1.7</target>
            </configuration>
        </plugin>
    </plugins>
</build>

私がそれに取り組んでいるのはある日ですが、この競合を引き起こす依存関係はどれなのか、まだわかりません。
何か案が?

4

3 に答える 3

2

mvn dependency:tree を使用して、取得している依存関係を見つけます。

spring-asm jar3.2以降のすべてがにマージされているため、この問題を引き起こしているようですspring-core

于 2013-04-25T11:52:59.503 に答える
2

spring-security 依存関係から spring asm を除外する

<exclusions>
    <exclusion>
        <groupId>org.springframework</groupId>
        <artifactId>spring-asm</artifactId>
    </exclusion>
</exclusions>
于 2013-09-11T11:51:18.653 に答える