struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastian Götz (JIRA) <j...@apache.org>
Subject [jira] [Commented] (WW-5005) Struts2 convention plugin lacks Java 11 support
Date Tue, 22 Jan 2019 09:36:00 GMT

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

Sebastian Götz commented on WW-5005:
------------------------------------

As we compile with JDK 11 already (class version 55) we get a lot of these exceptions (using
2.5.20):
 
 {{ java.lang.IllegalArgumentException}}
{{    at org.objectweb.asm.ClassReader.<init>(Unknown Source)}}
{{    at org.objectweb.asm.ClassReader.<init>(Unknown Source)}}
{{    at org.objectweb.asm.ClassReader.<init>(Unknown Source)}}
{{    at org.apache.struts2.convention.DefaultClassFinder.readClassDef(DefaultClassFinder.java:461)}}
{{    at org.apache.struts2.convention.DefaultClassFinder.<init>(DefaultClassFinder.java:93)}}
{{    at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildClassFinder(PackageBasedActionConfigBuilder.java:395)}}
{{    at org.apache.struts2.convention.PackageBasedActionConfigBuilder.findActions(PackageBasedActionConfigBuilder.java:377)}}
{{    at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionConfigs(PackageBasedActionConfigBuilder.java:333)}}
{{    at org.apache.struts2.convention.ClasspathPackageProvider.loadPackages(ClasspathPackageProvider.java:52)}}
{{    at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:206)}}
{{    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)}}
{{    at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:957)}}
{{    at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:463)}}
{{    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:496)}}
{{    at org.apache.struts2.dispatcher.InitOperations.initDispatcher(InitOperations.java:73)}}
{{    at org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:61)}}
{{    at eu.inform.servlet.context.URIExcludeFilter.init(URIExcludeFilter.java:37)}}
{{    at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:270)}}
{{    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:251)}}
{{    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:102)}}
{{    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4491)}}
{{    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5135)}}
{{    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)}}
{{    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1432)}}
{{    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1422)}}
{{    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)}}
{{    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)}}
{{    at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)}}
{{    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:944)}}
{{    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:831)}}
{{    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)}}
{{    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1432)}}
{{    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1422)}}
{{    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)}}
{{    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)}}
{{    at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)}}
{{    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:944)}}
{{    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:261)}}
{{    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)}}
{{    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)}}
{{    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)}}
{{    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:801)}}
{{    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)}}
{{    at org.apache.catalina.startup.Catalina.start(Catalina.java:695)}}
{{    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)}}
{{    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)}}
{{    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)}}
{{    at java.base/java.lang.reflect.Method.invoke(Method.java:566)}}
{{    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)}}
{{    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)}}
 
 I tried to exclude asm 5.2 in favor of 7.0 which works from the dependency resolving side.
But the Struts2 ClassVisitor implementation is tied to ASM 5:
 
{{public class InfoBuildingVisitor extends ClassVisitor {}}
{{        private Info info;}}
{{        private ClassFinder classFinder;}}

{{        public InfoBuildingVisitor(ClassFinder classFinder) {}}
{{            super(Opcodes.ASM5);}}
{{            this.classFinder = classFinder;}}
{{        }}}
{{...}}
{{}}}
 
 Therefore this leads to the following problem:
 
  {{java.lang.UnsupportedOperationException: This feature requires ASM7}}
{{    at org.objectweb.asm.ClassVisitor.visitNestMember(ClassVisitor.java:236)}}
{{    at org.objectweb.asm.ClassReader.accept(ClassReader.java:651)}}
{{    at org.objectweb.asm.ClassReader.accept(ClassReader.java:391)}}
{{    at org.apache.struts2.convention.DefaultClassFinder.readClassDef(DefaultClassFinder.java:462)}}
{{    at org.apache.struts2.convention.DefaultClassFinder.<init>(DefaultClassFinder.java:93)}}
{{    at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildClassFinder(PackageBasedActionConfigBuilder.java:395)}}
{{    at org.apache.struts2.convention.PackageBasedActionConfigBuilder.findActions(PackageBasedActionConfigBuilder.java:377)}}
{{    at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionConfigs(PackageBasedActionConfigBuilder.java:333)}}
{{    at org.apache.struts2.convention.ClasspathPackageProvider.loadPackages(ClasspathPackageProvider.java:52)}}
{{    at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:206)}}
{{    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)}}
{{    at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:957)}}
{{    at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:463)}}
{{    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:496)}}
{{    at org.apache.struts2.dispatcher.InitOperations.initDispatcher(InitOperations.java:73)}}
{{    at org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:61)}}
{{    at eu.inform.servlet.context.URIExcludeFilter.init(URIExcludeFilter.java:37)}}
{{    at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:270)}}
{{    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:251)}}
{{    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:102)}}
{{    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4491)}}
{{    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5135)}}
{{    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)}}
{{    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1432)}}
{{    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1422)}}
{{    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)}}
{{    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)}}
{{    at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)}}
{{    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:944)}}
{{    at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:831)}}
{{    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)}}
{{    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1432)}}
{{    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1422)}}
{{    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)}}
{{    at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)}}
{{    at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:140)}}
{{    at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:944)}}
{{    at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:261)}}
{{    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)}}
{{    at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)}}
{{    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)}}
{{    at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:801)}}
{{    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)}}
{{    at org.apache.catalina.startup.Catalina.start(Catalina.java:695)}}
{{    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)}}
{{    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)}}
{{    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)}}
{{    at java.base/java.lang.reflect.Method.invoke(Method.java:566)}}
{{    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)}}
{{    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)}}

> Struts2 convention plugin lacks Java 11 support
> -----------------------------------------------
>
>                 Key: WW-5005
>                 URL: https://issues.apache.org/jira/browse/WW-5005
>             Project: Struts 2
>          Issue Type: New Feature
>          Components: Plugin - Convention
>    Affects Versions: 2.5.20, 2.6
>            Reporter: Sebastian Götz
>            Priority: Major
>
> As discussed in the mailing list, the convention plugin is uncapable of analysing web
applications that have classes compiled with class versions higher than 52. This blocks users
that compile their web app projects with Java 9, 10 or 11.
> Excerpt from the mailing list discussion:
> I have taken a look at the struts-2-5-x branch in github. There is a global property
in the {{struts-parent}} of that defines the version for ASM:
> {{<asm.version>5.2</asm.version>}}
> The {{struts-master}} pom of the current github *master branch* has:
> {{<asm.version>7.0</asm.version>}}
> But when I look into {{DefaultClassFinder$InfoBuildingVisitor}} class (line 461) of the
*master branch* there is still ASM 5 used:
> {{public class InfoBuildingVisitor extends ClassVisitor {}}
>  {{        private Info info;}}
>  {{        private ClassFinder classFinder;}}
> {{        public InfoBuildingVisitor(ClassFinder classFinder) {}}
>              *{{super(Opcodes.ASM5);}}*
>  {{            this.classFinder = classFinder;}}
>  \{{        }}}
> So first step would be to change this coupling to ASM's version 7 API and check how this
affects classes compiled with Java 8 or below.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message