【bugFix】ASM ClassReader failed to parse class file

phenomenon

spring container initialization failed

error log is as follows:

Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class

nested exception is org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn't supported yet:

the reason

Spring java compiler version and version compatibility issues, due to the spring version 3.2.4 is relatively low, while the dependent jar package is compiled with 1.8 , resulting in spring class file read error

solution

1. Lift the spring version 4.2.5 or more other 4

2. rewrite jar package pom file to the java compiler version 1.6

    <properties>
        <project.build.sourceEncoding>GBK</project.build.sourceEncoding>
        <java.version>1.6</java.version>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

As the old project to change the spring version dependent risky, public version of the method has a high-low version incompatibilities, resulting in the need to modify the code,

And the jar package is to write, control is relatively large

So here choose the second option, successful deployment ~

Brothers question:

class file has wrong version 52.0, should be 50.0

 
发布了101 篇原创文章 · 获赞 89 · 访问量 1万+

Guess you like

Origin blog.csdn.net/sarafina527/article/details/104531305