sta*_*kov 78 java spring java-8
My web application runs fine on JDK 1.7 but crashes on 1.8 with the following exception (during application server startup with Jetty 8). I am using Spring version: 3.2.5.RELEASE.
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
I assume that problem occurs because of spring and "asm.jar" library on which it depends.
How do I resolve this?
Les*_*ała 112
As @prunge and @Pablo Lozano stated, you need Spring 4 if you want compile code to Java 8 (--target 1.8), but you can still run apps on Java 8 compiled to Java 7 if you run on Spring 3.2.X.
Check out http://docs.spring.io/spring/docs/current/spring-framework-reference/html/new-in-4.0.html
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.
小智 65
如果你使用-target 1.7编译时遇到这个错误,请注意这是因为Spring Framework中的一个错误导致ASM类重写器加载jdk类(java.*或javax.*),当然,用-target 1.8编译.
这与春季3.2.8及更低版本中的旧ASM版本相结合,不支持解析1.8类文件,也可能导致此错误.
有关该问题的更多信息,请访问:https://jira.spring.io/browse/SPR-11719
这应该在Spring Framework版本3.2.9中修复,该版本即将发布.
当然,升级到Spring Framework 4也将解决该问题,因为它已经包含更新版本的ASM.
但是,如果由于某种原因你还无法升级到版本4,那么很高兴知道有一种替代方案(很快).
| 归档时间: |
|
| 查看次数: |
80253 次 |
| 最近记录: |