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

﹥>﹥吖頭↗ 提交于 2019-11-27 04:24:05
Thanuja

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.

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.

Alex Bretet

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

I had similar issue and the root cause was other spring lib include spring-asm 3.1.0 as dependency.

Fixed this issue by exluding the 'spring-asm' from all configuration in my gradle build script.

configurations {
    all*.exclude group: 'org.springframework', module: 'spring-asm'
}

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>

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>

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

<exclusion>
    <groupId>org.springframework</groupId>
    <artifactId>spring-aop</artifactId>
</exclusion>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!