我的小组刚刚升级到java 8,并且有一些代码java.util.Optional映射代码似乎是罪魁祸首。
我们有很多这样的代码行,当然如果我们将它们评论出服务器启动就好了。
但是,我在其他组项目中使用了此可选映射sytax,并且在升级到java8时从未出现过问题。
有什么想法吗?运行jetty-9.2.5.v20141112
// this one definitely causes the server from starting up
// if you comment it out it start up just fine
java.util.Optional<DateRange> Dates = _obj.map(FactoryObject::getEntity).map(Entity::getDates);
错误:
mlWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘MyclassService’: Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: protected my project.namespace.service.ServiceUtil my project.namespace.service.ServiceUtil.impl.MyclassService.serviceUtil; nested exception is java.lang.VerifyError: Expecting a stackmap frame at branch target 143
Exception Details:
Reason:
Expected stackmap frame at this location.
Bytecode:
0x0000000: 2b3a 072c 3a08 b202 5c2a 2a19 0719 08b8
0x0000010: 0262 3a09 b802 7707 bd00 0b3a 0a19 0a03
0x0000020: 2a53 190a 0419 0753 190a 0519 0853 190a
0x0000030: 0619 0953 bb02 6759 190a b702 6a13 026b
0x0000040: b602 71b2 027d 59c7 0025 5712 a113 027e
0x0000050: 05bd 0280 5903 1301 2e53 5904 1213 53b6
0x0000060: 0284 1302 79b6 028a 59b3 027d 00c0 0279
0x0000070: b602 90c0 0013 b0
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:542) ~[spring-beans-4.1.0.RELEASE.jar:4.1.0.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) ~[spring-beans-4.1.0.RELEASE.jar:4.1.0.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:323) ~[spring-beans-4.1.0.RELEASE.jar:4.1.0.RELEASE]
... 60 common frames omitted
Caused by: java.lang.VerifyError: Expecting a stackmap frame at branch target 108
Exception Details:
Location: