You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Bertrand Gillis (JIRA)" <ji...@apache.org> on 2014/12/18 16:26:14 UTC

[jira] [Commented] (WW-4347) Support for JDK 8 Lambdas

    [ https://issues.apache.org/jira/browse/WW-4347?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14251792#comment-14251792 ] 

Bertrand Gillis commented on WW-4347:
-------------------------------------

This ASM update makes Struts2 incompatible with CXF.

As a matter of fact, CXF depends on ASM 3 (3.3.1) and is incompatible with ASM 5 (5.0.2). The main issue is with ClassVisitor, MethodVisitor, etc interfaces replaced with abstract classes, in order to ensure backward binary compatibility in future ASM versions.

It is a bit surprising to add new features (support for JDK 8 Lambdas) with a bug fix release of Struts2; even more if a Struts2 dependency as ASM is upgraded to its latest major version. Moreover, Struts2 is still mainly used in Java 6 and Java 7 environments. Support for Java 8 Lambdas should have been added in a minor release of Struts2 instead.

Do you have any workaround to solve this incompatibility issue between Struts2, ASM and CXF ?

> Support for JDK 8 Lambdas
> -------------------------
>
>                 Key: WW-4347
>                 URL: https://issues.apache.org/jira/browse/WW-4347
>             Project: Struts 2
>          Issue Type: New Feature
>          Components: Core Actions
>    Affects Versions: 2.3.16.3
>            Reporter: Erik Berg
>            Assignee: Lukasz Lenart
>              Labels: jdk8
>             Fix For: 2.3.20
>
>         Attachments: jdk8test.tar
>
>
> Struts stumbles when encountering lambda expressions in JDK 8. Looks like org.objwectweb.asm dependency needs to be updated...
> {code}
> 2014-05-18 10:21:41,111 ERROR (com.opensymphony.xwork2.util.finder.ClassFinder:38) - Unable to read class [jdk8test.actions.Lambda]
> java.lang.ArrayIndexOutOfBoundsException: 52264
> 	at org.objectweb.asm.ClassReader.readClass(Unknown Source)
> 	at org.objectweb.asm.ClassReader.accept(Unknown Source)
> 	at org.objectweb.asm.ClassReader.accept(Unknown Source)
> 	at com.opensymphony.xwork2.util.finder.ClassFinder.readClassDef(ClassFinder.java:717)
> 	at com.opensymphony.xwork2.util.finder.ClassFinder.<init>(ClassFinder.java:112)
> 	at org.apache.struts2.convention.PackageBasedActionConfigBuilder.findActions(PackageBasedActionConfigBuilder.java:390)
> 	at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionConfigs(PackageBasedActionConfigBuilder.java:347)
> 	at org.apache.struts2.convention.ClasspathPackageProvider.loadPackages(ClasspathPackageProvider.java:53)
> 	at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:268)
> 	at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
> 	at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:445)
> 	at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:489)
> 	at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
> 	at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57)
> 	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
> 	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
> 	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)
> 	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4775)
> 	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5452)
> 	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
> 	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
> 	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> 	at java.lang.Thread.run(Thread.java:744)
> {code}
> Simple test case attached.
> tar xvf jdk8test.tar
> cd jdk8test
> mvn tomcat7:run
> http://localhost:8080/jdk8test



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)