Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-5207

Convention Plugin - support for ASM 9

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 6.0.0
    • 6.0.3
    • Plugin - Convention
    • None

    Description

      According to https://issues.apache.org/jira/browse/WW-5148 support for ASM 9.2 was implemented which implied support for JAVA 17.  Unfortunately, this is not true, because convention plugin fails to start when app is compiled with JAVA17

      This issue is very similar to https://issues.apache.org/jira/browse/WW-5005 which concerned JAVA 11.

      Convention plugin contains code

       public class InfoBuildingVisitor extends ClassVisitor {
          private Info info;
          private ClassFinder classFinder;
      
          public InfoBuildingVisitor(ClassFinder classFinder) {
              super(Opcodes.ASM7);
              this.classFinder = classFinder;
          }

      which limits usage only to ASM7

      Right now following exception it thrown if you try to run struts 6.0 app compiled with java 17

      java.lang.UnsupportedOperationException: PermittedSubclasses requires ASM9
              at org.objectweb.asm.ClassVisitor.visitPermittedSubclass(ClassVisitor.java:266) ~[asm-9.2.jar:9.2]
              at org.objectweb.asm.ClassReader.accept(ClassReader.java:706) ~[asm-9.2.jar:9.2]
              at org.objectweb.asm.ClassReader.accept(ClassReader.java:424) ~[asm-9.2.jar:9.2]
              at org.apache.struts2.convention.DefaultClassFinder.readClassDef(DefaultClassFinder.java:445) ~[struts2-convention-plugin-6.0.0.jar:6.0.0]
              at org.apache.struts2.convention.DefaultClassFinder.<init>(DefaultClassFinder.java:93) ~[struts2-convention-plugin-6.0.0.jar:6.0.0]
              at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildClassFinder(PackageBasedActionConfigBuilder.java:399) ~[struts2-convention-plugin-6.0.0.jar:6.0.0]
              at org.apache.struts2.convention.PackageBasedActionConfigBuilder.findActions(PackageBasedActionConfigBuilder.java:381) ~[struts2-convention-plugin-6.0.0.jar:6.0.0]
              at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionConfigs(PackageBasedActionConfigBuilder.java:337) ~[struts2-convention-plugin-6.0.0.jar:6.0.0]
              at org.apache.struts2.convention.ClasspathPackageProvider.loadPackages(ClasspathPackageProvider.java:52) ~[struts2-convention-plugin-6.0.0.jar:6.0.0]
              at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:228) ~[struts2-core-6.0.0.jar:6.0.0]
              at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:65) ~[struts2-core-6.0.0.jar:6.0.0]
              at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:1035) ~[struts2-core-6.0.0.jar:6.0.0]
              at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:516) ~[struts2-core-6.0.0.jar:6.0.0]
              at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:549) ~[struts2-core-6.0.0.jar:6.0.0]
              at org.apache.struts2.dispatcher.InitOperations.initDispatcher(InitOperations.java:44) ~[struts2-core-6.0.0.jar:6.0.0]
              at org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:60) ~[struts2-core-6.0.0.jar:6.0.0]
       

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            mhankus Mirek Hankus
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 0.5h
                0.5h

                Slack

                  Issue deployment