Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-9039

JAXB handling with Java 11 still erroneous

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.5.6
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      I just installed Groovy 2.5.6 and tried to use it to call some Groovy script that calls another Groovy script, but this doesn't work properly with Java 11.

      I boiled it down to this:

      If I call (from Cygwin Bash) groovy -d -e "println 'FOO'" it works fine and prints FOO.
      But if I call groovy -e "println \"\"\"groovy -d -e \"println 'FOO'\" \"\"\".execute().errorStream.text", I get the exception

      Caught: java.lang.NoClassDefFoundError: Unable to load class org.apache.groovy.jaxb.extensions.JaxbExtensions due to missing dependency javax/xml/bind/JAXBContext
      java.lang.NoClassDefFoundError: Unable to load class org.apache.groovy.jaxb.extensions.JaxbExtensions due to missing dependency javax/xml/bind/JAXBContext
              at org.codehaus.groovy.vmplugin.v5.Java5.configureClassNode(Java5.java:409)
              at org.codehaus.groovy.ast.ClassNode.lazyClassInit(ClassNode.java:280)
              at org.codehaus.groovy.ast.ClassNode.getMethods(ClassNode.java:400)
              at org.codehaus.groovy.macro.transform.MacroMethodsCache.scanExtClasses(MacroMethodsCache.java:88)
              at org.codehaus.groovy.macro.transform.MacroMethodsCache.access$000(MacroMethodsCache.java:45)
              at org.codehaus.groovy.macro.transform.MacroMethodsCache$2.onModule(MacroMethodsCache.java:69)
              at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanExtensionModuleFromProperties(ExtensionModuleScanner.java:87)
              at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanExtensionModuleFromMetaInf(ExtensionModuleScanner.java:81)
              at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanClasspathModulesFrom(ExtensionModuleScanner.java:63)
              at org.codehaus.groovy.runtime.m12n.ExtensionModuleScanner.scanClasspathModules(ExtensionModuleScanner.java:54)
              at org.codehaus.groovy.macro.transform.MacroMethodsCache.getMacroMethodsFromClassLoader(MacroMethodsCache.java:76)
              at org.codehaus.groovy.macro.transform.MacroMethodsCache$1.provide(MacroMethodsCache.java:53)
              at org.codehaus.groovy.macro.transform.MacroMethodsCache$1.provide(MacroMethodsCache.java:50)
              at org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache.getAndPut(ConcurrentCommonCache.java:147)
              at org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache.getAndPut(ConcurrentCommonCache.java:123)
              at org.codehaus.groovy.macro.transform.MacroMethodsCache.get(MacroMethodsCache.java:50)
              at org.codehaus.groovy.macro.transform.MacroCallTransformingVisitor.findMacroMethods(MacroCallTransformingVisitor.java:117)
              at org.codehaus.groovy.macro.transform.MacroCallTransformingVisitor.visitMethodCallExpression(MacroCallTransformingVisitor.java:88)
              at org.codehaus.groovy.ast.expr.MethodCallExpression.visit(MethodCallExpression.java:68)
              at org.codehaus.groovy.ast.CodeVisitorSupport.visitExpressionStatement(CodeVisitorSupport.java:120)
              at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitExpressionStatement(ClassCodeVisitorSupport.java:197)
              at org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:40)
              at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:86)
              at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:106)
              at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:69)
              at org.codehaus.groovy.ast.MethodCallTransformation.visit(MethodCallTransformation.java:42)
              at org.codehaus.groovy.transform.ASTTransformationVisitor$3.call(ASTTransformationVisitor.java:318)
              at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:965)
              at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:647)
              at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:623)
              at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:600)
              at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:390)
              at groovy.lang.GroovyClassLoader.access$300(GroovyClassLoader.java:89)
              at groovy.lang.GroovyClassLoader$5.provide(GroovyClassLoader.java:330)
              at groovy.lang.GroovyClassLoader$5.provide(GroovyClassLoader.java:327)
              at org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache.getAndPut(ConcurrentCommonCache.java:147)
              at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:325)
              at groovy.lang.GroovyShell.parseClass(GroovyShell.java:540)
              at groovy.lang.GroovyShell.run(GroovyShell.java:369)
              at groovy.lang.GroovyShell.run(GroovyShell.java:359)
              at groovy.ui.GroovyMain.processOnce(GroovyMain.java:588)
              at groovy.ui.GroovyMain.run(GroovyMain.java:332)
              at groovy.ui.GroovyMain.access$1400(GroovyMain.java:69)
              at groovy.ui.GroovyMain$GroovyCommand.process(GroovyMain.java:291)
              at groovy.ui.GroovyMain.processArgs(GroovyMain.java:134)
              at groovy.ui.GroovyMain.main(GroovyMain.java:116)
              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.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:110)
              at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:128)
      

      Interestingly, if I call it from cmd.exe, I get the exception even with groovy -d -e "println 'FOO'" already.

      If I do the first or third bulletpoint of the bottom list at http://groovy-lang.org/releasenotes/groovy-2.5.html#Groovy2.5releasenotes-Addendum251, the error goes away.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              vampire Björn Kautler
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: