简体   繁体   English

Java 7到Java 8迁移Spring bean创建异常

[英]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. 我正在将Java 7迁移到Java 8,并尝试继续使用Spring 3.2。 When try to run the application, throwing spring bean creation errors. 当尝试运行应用程序时,抛出Spring bean创建错误。 Error creating bean with name 'something': cannot create inner bean ...etc. 创建名称为“ something”的bean时出错:无法创建内部bean ... etc。

I dont see any application related issues, Is Spring 3.2 compatible for Java8? 我没有看到任何与应用程序相关的问题,Spring 3.2是否与Java8兼容? Or else should I upgrade Spring 4.0 .? 否则我应该升级Spring 4.0吗?

Java 8 support in the 3.2.x line: 3.2.x行中的Java 8支持:

  • Spring Framework 3.2.x is based on unpatched repackaged versions of ASM and CGLIB. Spring Framework 3.2.x基于ASM和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. 此时,计划将其作为Spring 3.2.9的ASM 5.0.1和CGLIB 3.1,提供基本的Java 8字节码兼容性。 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+. 但是,对于Spring Framework 4的ASM的本地分叉版本,已经存在ASM 5.0.1以外的补丁程序,以及针对“ -parameters”编译器标志的其他CGLIB 3.1兼容性补丁程序,所有这些补丁程序都计划在Spring Framework 4.0.4中使用。因此,如果Java 8字节码处理存在任何问题,特别是与“ -parameters”标志结合使用,我们敦促您升级到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. 在3.2.9中将不会解决此问题,因为我们不再在此处引入本地ASM分支。

  • Spring Framework 3.2.x uses AspectJ 1.7.4. Spring Framework 3.2.x使用AspectJ 1.7.4。 For full Java 8 support in AspectJ, you'll have to use AspectJ 1.8. 为了获得AspectJ的完整Java 8支持,您必须使用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. 我们只是在Spring Framework 4.0.4+中正式支持AspectJ 1.8 final。即使它也可能与Spring Framework 3.2.x一起使用,我们也没有正式支持它。

  • 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. 总而言之,就接受Java 8字节码级别而言,Spring Framework 3.2.9中的Java 8支持将只是“尽力而为”。 For comprehensive Java 8 support, go Spring 4+. 要全面支持Java 8,请使用Spring 4+。

please refer https://jira.spring.io/browse/SPR-11656 for more details. 请参阅https://jira.spring.io/browse/SPR-11656了解更多详细信息。

Spring current version is Spring 4.3.0 Spring当前版本是Spring 4.3.0

How do you expect Spring 3.2 which is released in 2013-14 expected to support java 8? 您如何期待2013-14年发布的Spring 3.2预期支持Java 8? which is released in mid of 2014. 将于2014年中发布。

Spring 3.2 doesn't support java 8. Spring 3.2不支持Java 8。

Yes Spring 4.x support java 8 是Spring 4.x支持Java 8

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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