Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-14457

Groovy language: NoClassDefFoundError in OSGi environment

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.0, 3.0.1
    • Fix Version/s: 3.1.0, 3.0.2
    • Component/s: camel-groovy
    • Labels:
      None
    • Environment:

      Apache Karaf 4.2.8

    • Estimated Complexity:
      Unknown

      Description

      With Camel 3.0.1, I am experiencing this error:
       

      java.lang.RuntimeException: java.lang.NoClassDefFoundError: groovy/lang/Script
      {{ at org.codehaus.groovy.control.CompilationUnit.convertUncaughtExceptionToCompilationError(CompilationUnit.java:1107)}}
      {{ at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1087)}}
      {{ at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:634)}}
      {{ at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:612)}}
      {{ at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:589)}}
      {{ at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:401)}}
      {{ at groovy.lang.GroovyClassLoader.access$300(GroovyClassLoader.java:89)}}
      {{ at groovy.lang.GroovyClassLoader$5.provide(GroovyClassLoader.java:341)}}
      {{ at groovy.lang.GroovyClassLoader$5.provide(GroovyClassLoader.java:338)}}
      {{ at org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache.getAndPut(ConcurrentCommonCache.java:147)}}
      {{ at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:336)}}
      {{ at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:320)}}
      {{ at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:262)}}
      {{ at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:272)}}
      {{ at org.apache.camel.language.groovy.GroovyExpression.instantiateScript(GroovyExpression.java:73)}}

       
       
      I am running Camel in Karaf OSGi environment with camel-groovy feature installed.  In old Camel 2.X, I had to install features camel-script, and camel-script-groovy, but they are no longer available.
       
      Adding:

      DynamicImport-Package:  groovy.*, org.codehaus.groovy.*

      Fixes the issue.
       

        Attachments

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              alex.soto Alex Soto
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: