Class Conflict when starting up Java project: ClassMetadataReadingVisitor has interface org.springframework.asm.ClassVisitor as super class

前端 未结 7 2029
臣服心动
臣服心动 2020-11-30 06:29

I am developing a Java web project using the latest Spring framework version (3.2.2-RELEASE), but now I have a problem when the project is started up. The detail error is

相关标签:
7条回答
  • 2020-11-30 07:11

    Same issue for me. I ran 'mvn dependency:tree' and noticed that an older version of spring-aop was being brought in so I added it to the jersey-spring exclusions, which corrected my problem:

        <dependency>
            <groupId>com.sun.jersey.contribs</groupId>
            <artifactId>jersey-spring</artifactId>
            <version>${jersey.version}</version>
            <exclusions>
                <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>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-aop</artifactId>
                </exclusion>
            </exclusions>
            <scope>provided</scope>
        </dependency>
    
    0 讨论(0)
  • 2020-11-30 07:12

    I ran into the same problem when trying to add Spring security to the application. The problem was resolved by adding

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>3.2.2.RELEASE</version>
    </dependency>
    
    0 讨论(0)
  • 2020-11-30 07:20

    I solved my same problem after I generated a mvn dependency:tree and looked for older spring versions in my tree. Indeed, there was a dependency to org.springframework:spring-asm:3.0.7-RELEASE in my dependencies.

    0 讨论(0)
  • 2020-11-30 07:24

    I resolved the problem adding following exclusion in jersey-spring dependency.

    <exclusion>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aop</artifactId>
    </exclusion>
    
    0 讨论(0)
  • 2020-11-30 07:27

    I resolved the same problem by reordering the pom dependencies.

    I got issue from org.springframework.security. So I brought it to end of the dependencies.

    0 讨论(0)
  • 2020-11-30 07:30

    If you are using a spring version > 3.2.0, you no longer need to include specifically spring-asm since it has been included in spring-core.

    Remove spring-asm from your build definition and ensure that spring-core is there.

    See http://docs.spring.io/spring-framework/docs/3.2.16.RELEASE/spring-framework-reference/htmlsingle/#migration-3.2-inline-asm

    0 讨论(0)
提交回复
热议问题