2 Replies Latest reply on Oct 15, 2009 4:22 AM by Christian Müller

    Problem with camel-ognl within FUSE ESB 4.1.0.2

    Christian Müller Newbie

      Hello all!

       

      In my project, I use camel-ognl like following:

      from(...)
      .setHeader("to",  org.apache.camel.language.ognl.OgnlExpression.ognl("request.body.eMail"))
      .to(...);
      

       

      I installed the camel-ognl feature which installed two bundles:

      [ 108] [Active     ] [       ] [   60] Apache ServiceMix Bundles: ognl-2.7.3 (2.7.3.fuse)
      [ 109] [Active     ] [       ] [   60] camel-ognl (1.6.1.fuse)
      

       

      When I run my code, I got the following exception:

       

      23:11:23,217 | ERROR | tenerContainer-9 | DeadLetterChannel                | rg.apache.camel.processor.Logger  203 | Failed delivery for exchangeId: ID-christian-muellers-macbook-pro.local/57418-1255467434995/0-13. On delivery attempt: 0 caught: java.lang.NoClassDefFoundError: javassist/ClassPath
      java.lang.NoClassDefFoundError: javassist/ClassPath
              at ognl.OgnlRuntime.<clinit>(OgnlRuntime.java:155)
              at ognl.ASTProperty.getIndexedPropertyType(ASTProperty.java:88)
              at ognl.ASTChain.getValueBody(ASTChain.java:90)
              at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)
              at ognl.SimpleNode.getValue(SimpleNode.java:258)
              at ognl.Ognl.getValue(Ognl.java:494)
              at ognl.Ognl.getValue(Ognl.java:458)
              at org.apache.camel.language.ognl.OgnlExpression.evaluate(OgnlExpression.java:59)
              at org.apache.camel.builder.ProcessorBuilder$4.process(ProcessorBuilder.java:94)
              at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:80)
              at org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(StreamCachingInterceptor.java:87)
              at org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:82)
              at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:189)
              at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:133)
              at org.apache.camel.processor.Pipeline.process(Pipeline.java:115)
              at org.apache.camel.processor.Pipeline.process(Pipeline.java:89)
              at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
              at org.apache.camel.processor.interceptor.StreamCachingInterceptor.proceed(StreamCachingInterceptor.java:87)
              at org.apache.camel.processor.interceptor.StreamCachingInterceptor.process(StreamCachingInterceptor.java:82)
              at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52)
              at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:41)
              at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:66)
              at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:72)
              at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:543)
              at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:482)
              at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:451)
              at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:323)
              at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:261)
              at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:982)
              at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:881)
              at java.lang.Thread.run(Thread.java:637)
      Caused by: java.lang.ClassNotFoundException: javassist.ClassPath
              at org.apache.felix.framework.searchpolicy.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:558)
              at org.apache.felix.framework.searchpolicy.ModuleImpl.access$100(ModuleImpl.java:59)
              at org.apache.felix.framework.searchpolicy.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1427)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:254)
              at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:399)
              ... 31 more
      

       

      I looked in the header of the bundle Apache ServiceMix Bundles: ognl-2.7.3 and saw, that the import of the package javassist is optional:

       

      Apache ServiceMix Bundles: ognl-2.7.3 (108)
      -------------------------------------------
      Tool = Bnd-0.0.255
      Bundle-DocURL = http://www.apache.org/
      Bundle-Description = This bundle simply wraps ognl-2.7.3.jar.
      Export-Package = ognl.internal;uses:=ognl;version="2.7.3",ognl.enhance;uses:="ognl,javassist";version="2.7.3",ognl;uses:="ognl.internal,ognl.enhance";version="2.7.3"
      Bundle-Version = 2.7.3.fuse
      Build-Jdk = 1.5.0_12
      Created-By = Apache Maven Bundle Plugin
      Bundle-License = http://www.apache.org/licenses/LICENSE-2.0.txt
      Bundle-ManifestVersion = 2
      Manifest-Version = 1.0
      Bundle-Vendor = The Apache Software Foundation
      Bnd-LastModified = 1223474443538
      Bundle-Name = Apache ServiceMix Bundles: ognl-2.7.3
      Built-By = cruise
      Import-Package = javassist;resolution:=optional,ognl;version="2.7.3",ognl.enhance;version="2.7.3",ognl.internal;version="2.7.3"
      Bundle-SymbolicName = org.apache.servicemix.bundles.ognl
      

       

      Question 1: Is the import of the package javassist really optional? I don't think so...

      Question 2: Would it be nice, if we provide an osgi bundle for that library? Because in my case, the resolution is required... I could provide a patch for that. Should I do that?

      Question 3: Should I raise an issue by Apache for that?

      Question 4: If the resolution is not optional, we have also to patch the pom.xml of the bundle org.apache.servicemix.bundles.ognl and the features.xml. I could provide a patch for that. Should I do that?

       

      Thanks,

      Christian