0 Replies Latest reply on Jun 30, 2011 5:26 AM by urgo

    NoClassDefFoundError: CompilationFailedException when using Groovy bean

    urgo

      When using Groovy bean in Spring context of bundle like this:

      <lang:groovy id="reportPage" script-source="classpath:ReportPage.groovy"/>

       

      then I sometimes get following exception when trying to deploy my bundle to Fuse:

       

      Exception in thread "SpringOsgiExtenderThread-20" java.lang.NoClassDefFoundError: org/codehaus/groovy/control/CompilationFailedException

       

      ...

      at org.springframework.scripting.support.ScriptFactoryPostProcessor.prepareScriptBeans(ScriptFactoryPostProcessor.java:334)

              at org.springframework.scripting.support.ScriptFactoryPostProcessor.predictBeanType(ScriptFactoryPostProcessor.java:233)

              at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:584)

      ....

       

      We should have correct imports for Groovy in our manifest:

      groovy.lang;version="[1.5.0, 2.0.0)",

      groovy.util;version="[1.5.0, 2.0.0)",

      org.codehaus.groovy.reflection;version="[1.5.0, 2.0.0)",

      org.codehaus.groovy.runtime;version="[1.5.0, 2.0.0)",

      org.codehaus.groovy.runtime.callsite;version="[1.5.0, 2.0.0)",

      org.codehaus.groovy.control;version="[1.5.0, 2.0.0)",

      org.codehaus.groovy.runtime.typehandling;version="[1.5.0, 2.0.0)"

       

      In our feature definition XML we have added dependency on camel-groovy which contains installing Groovy Runtime.

      When I list installed OSGI bundles I see that Groovy Runtime (1.7.5) is in "Active" state.

       

      As I said this error seems to be appearing randomly.

      I'm using Fuse version: 4.3.1-fuse-01-15

       

       

      All ideas are welcome!

       

      Edited by: urgo on Jun 30, 2011 9:25 AM