Uploaded image for project: 'Magnolia Groovy Module'
  1. Magnolia Groovy Module
  2. MGNLGROOVY-183

Groovy 2.5.0 doesn't work with Java 11

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Neutral
    • 2.7.3
    • None
    • None
    • None
    • Yes
    • UI Framework 14
    • 1

    Description

      According to the certified stack of Magnolia 5.7, Java 11 is supported. However, when it comes to groovy script execution, it is failing whereas same script with java 8 works ok. This is not happening in Magnolia 6.1

      Steps to reproduce:

      1. Execute the following script in Magnolia 5.7.X with java 8
        import info.magnolia.cms.security.MgnlUser;
        import info.magnolia.context.MgnlContext;
        MgnlUser user = MgnlContext.getUser();
        println user.getName();
        
      1. Switch jdk to java 11 and execute it again. You will see following error:
        General error during semantic analysis: Unsupported class file major version 55
         
        java.lang.IllegalArgumentException: Unsupported class file major version 55
            at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:166)
            at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:148)
            at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:136)
            at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:237)
            at org.codehaus.groovy.ast.decompiled.AsmDecompiler.parseClass(AsmDecompiler.java:82)
            at org.codehaus.groovy.control.ClassNodeResolver.findDecompiled(ClassNodeResolver.java:254)
        ....
         
        1 error
         
        mgnl>  
        

      You can get rid of the issue by replacing groovy-2.5.0.jar and groovy-xml-2.5.0.jar with groovy-2.5.7.jar and groovy-xml-2.5.7.jar. Therefore, groovy dependencies within the BOM for third party modules of Magnolia 5.7 should be updated to 2.5.7 like in Magnolia 6.1

       

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                fgrilli Federico Grilli
                jayala Jonathan Ayala
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR
                    Task DoD