简体   繁体   中英

java 7 to java 8 migration spring bean creation exception

I am migrating Java 7 to Java 8 , and trying to continue with Spring 3.2. When try to run the application, throwing spring bean creation errors. Error creating bean with name 'something': cannot create inner bean ...etc.

I dont see any application related issues, Is Spring 3.2 compatible for Java8? Or else should I upgrade Spring 4.0 .?

Java 8 support in the 3.2.x line:

  • Spring Framework 3.2.x is based on unpatched repackaged versions of ASM and CGLIB. At this point, that's planned to be ASM 5.0.1 and CGLIB 3.1 for Spring 3.2.9, providing basic Java 8 bytecode compatibility. However, for Spring Framework 4's locally forked version of ASM, there's already a patch beyond ASM 5.0.1 as well as additional CGLIB 3.1 compatibility patches for the "-parameters" compiler flag, all scheduled to go into Spring Framework 4.0.4... So if there are any issues with Java 8 bytecode handling, in particular in combination with the "-parameters" flag, we urge you to upgrade to Spring Framework 4.0.4+. This won't be addressed in 3.2.9 since we're not going to introduce a local ASM fork there anymore.

  • Spring Framework 3.2.x uses AspectJ 1.7.4. For full Java 8 support in AspectJ, you'll have to use AspectJ 1.8. We're only officially supporting AspectJ 1.8 final in Spring Framework 4.0.4+... Even if it is likely to work with Spring Framework 3.2.x as well, we're not officially supporting it.

  • All in all, Java 8 support in Spring Framework 3.2.9 will just be "best effort" in terms of accepting the Java 8 bytecode level. For comprehensive Java 8 support, go Spring 4+.

please refer https://jira.spring.io/browse/SPR-11656 for more details.

Spring current version is Spring 4.3.0

How do you expect Spring 3.2 which is released in 2013-14 expected to support java 8? which is released in mid of 2014.

Spring 3.2 doesn't support java 8.

Yes Spring 4.x support java 8

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM