前言
维护很久以前的项目时,出现这个问题:ASM ClassReader failed to parse class file
分析
经过网上搜索该问题,发现是spring版本引起的。
Note that the Java 8 bytecode level (-target 1.8, as required by -source 1.8) is only fully supported as of Spring Framework 4.0. In particular, Spring 3.2 based applications need to be compiled with a maximum of Java 7 as the target, even if they happen to be deployed onto a Java 8 runtime. Please upgrade to Spring 4 for Java 8 based applications.
出问题的项目中使用的 spring 版本为3.2.8,jdk使用了java8。
解决办法
该问题的解决办法方案有两条:
a. 使用jdk7
b. 升级spring 4
参考
https://blog.csdn.net/blueheart20/article/details/50150529
https://stackoverflow.com/questions/22526695/java-1-8-asm-classreader-failed-to-parse-class-file-probably-due-to-a-new-java
https://stackoverflow.com/questions/36820068/asm-classreader-failed-to-parse-class-file-probably-due-to-a-new-java-class-fi