[MGNLGROOVY-183] Groovy 2.5.0 doesn't work with Java 11 Created: 13/Nov/19  Updated: 20/Jan/20  Resolved: 15/Jan/20

Status: Closed
Project: Magnolia Groovy Module
Component/s: None
Affects Version/s: None
Fix Version/s: 2.7.3

Type: Bug Priority: Neutral
Reporter: Jonathan Ayala Assignee: Federico Grilli
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
causality
relation
is related to MGNLGROOVY-184 Update Groovy dependency to the lates... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Release notes required:
Yes
Epic Link: Support
Sprint: UI Framework 14
Story Points: 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

 


Generated at Mon Feb 12 05:56:24 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.