2 Replies Latest reply on Feb 21, 2014 1:43 PM by Mason Tran

    ognl in camel-context.xml Unable to resolve custom class

    Mason Tran Newbie

      Hello everyone,

       

      I am having some issues with JBoss Fuse (jboss-fuse-6.0.0.redhat-024) with my camel project.  It is not able to resolve my custom class when it is being use in the camel-context.xml file.  Basically my camel project contains an idl file and when it get build it created few classes and package into the bundle.  And the bundle is exporting that package which contains org.omg.dds.demo.ShapeType class.  And when the camel route get start, this class is not able to resolve by the Apache ServiceMix :: Bundles :: ognl (3.0.5.1).  In order to get it to resolve my custom class, I need to open up this Apache ServiceMix bundle and add "DynamicImport-Package = *" to the "MANIFEST.MF" file.  I don't want to do this, is there a way to get it resolve, or is there something else that I am missing.

       

      Thanks,

      Mason Tran

       

       

      camel-context.xml

      <camel:ognl>new org.omg.dds.demo.ShapeType('yellow',1,1,1)</camel:ognl>

       

       

      ************************************************************************************************************************

       

      gov.mace.snc.e2.org.omg.dds.demo.ShapeType.publisher (246)

      ----------------------------------------------------------

      Manifest-Version = 1.0

      Bnd-LastModified = 1392754751569

      Tool = Bnd-1.50.0

      Built-By = Visumpoint

      Build-Jdk = 1.7.0_25

      Created-By = Apache Maven Bundle Plugin

       

       

      Bundle-Vendor = SNC

      Bundle-Name = gov.mace.snc.e2.org.omg.dds.demo.ShapeType.publisher

      Bundle-DocURL = http://snc.mace.gov

      Bundle-SymbolicName = org.omg.dds.demo.ShapeType.publisher

      Bundle-Version = 0.0.1.SNAPSHOT

      Bundle-License = http://www.apache.org/licenses/LICENSE-2.0.txt

      Bundle-ManifestVersion = 2

       

       

      Import-Package =

              ognl;version="[3.0,4)",

              org.apache.camel.osgi;version="[2.10,3)",

              org.omg.CORBA,

              org.omg.CORBA.portable

      Export-Package =

              org.omg.dds.demo;uses:="org.omg.CORBA.portable,org.omg.CORBA";version=0.0.1.SNAPSHOT

       

      ************************************************************************************************************************

       

      Error in karaf.log

       

      org.apache.camel.ExpressionEvaluationException: ognl.MethodFailedException: Method "new" failed for object org.omg.dds.demo.ShapeType [java.lang.ClassNotFoundException: Unable to resolve class: org.omg.dds.demo.ShapeType]

        at org.apache.camel.language.ognl.OgnlExpression.evaluate(OgnlExpression.java:60)[132:org.apache.camel.camel-ognl:2.10.0.redhat-60024]

        at org.apache.camel.processor.SetBodyProcessor.process(SetBodyProcessor.java:38)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.fabric.FabricTraceProcessor.process(FabricTraceProcessor.java:81)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:334)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:308)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.Pipeline.process(Pipeline.java:117)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:336)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:189)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:155)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:142)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:92)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_25]

        at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)[:1.7.0_25]

        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)[:1.7.0_25]

        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)[:1.7.0_25]

        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.7.0_25]

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_25]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_25]

        at java.lang.Thread.run(Thread.java:724)[:1.7.0_25]

      Caused by: ognl.MethodFailedException: Method "new" failed for object org.omg.dds.demo.ShapeType [java.lang.ClassNotFoundException: Unable to resolve class: org.omg.dds.demo.ShapeType]

        at ognl.OgnlRuntime.callConstructor(OgnlRuntime.java:1405)[211:org.apache.servicemix.bundles.ognl:3.0.5.1]

        at ognl.ASTCtor.getValueBody(ASTCtor.java:121)[211:org.apache.servicemix.bundles.ognl:3.0.5.1]

        at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)[211:org.apache.servicemix.bundles.ognl:3.0.5.1]

        at ognl.SimpleNode.getValue(SimpleNode.java:258)[211:org.apache.servicemix.bundles.ognl:3.0.5.1]

        at ognl.Ognl.getValue(Ognl.java:494)[211:org.apache.servicemix.bundles.ognl:3.0.5.1]

        at ognl.Ognl.getValue(Ognl.java:458)[211:org.apache.servicemix.bundles.ognl:3.0.5.1]

        at org.apache.camel.language.ognl.OgnlExpression.evaluate(OgnlExpression.java:57)[132:org.apache.camel.camel-ognl:2.10.0.redhat-60024]

        ... 49 more

      Caused by: java.lang.ClassNotFoundException: Unable to resolve class: org.omg.dds.demo.ShapeType

        at ognl.OgnlRuntime.classForName(OgnlRuntime.java:1035)[211:org.apache.servicemix.bundles.ognl:3.0.5.1]

        at ognl.OgnlRuntime.callConstructor(OgnlRuntime.java:1365)[211:org.apache.servicemix.bundles.ognl:3.0.5.1]

        ... 55 more

      2014-02-17 11:20:52,608 | WARN  | blisher/src/data | GenericFileOnCompletion          | ent.file.GenericFileOnCompletion  151 | 121 - org.apache.camel.camel-core - 2.10.0.redhat-60024 | Rollback file strategy: org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@5c4dcb7c for file: GenericFile[C:\Users\Visumpoint\workspace\org.omg.dds.demo.ShapeType.publisher\src\data\CommandMessageDisallowPerson.xmi]

      2014-02-17 11:20:53,113 | ERROR | blisher/src/data | DefaultErrorHandler              | rg.apache.camel.util.CamelLogger  215 | 121 - org.apache.camel.camel-core - 2.10.0.redhat-60024 | Failed delivery for (MessageId: ID-Visumpoint-PC-58305-1392653850112-0-787 on ExchangeId: ID-Visumpoint-PC-58305-1392653850112-0-788). Exhausted after delivery attempt: 1 caught: org.apache.camel.ExpressionEvaluationException: ognl.MethodFailedException: Method "new" failed for object org.omg.dds.demo.ShapeType [java.lang.ClassNotFoundException: Unable to resolve class: org.omg.dds.demo.ShapeType]

      org.apache.camel.ExpressionEvaluationException: ognl.MethodFailedException: Method "new" failed for object org.omg.dds.demo.ShapeType [java.lang.ClassNotFoundException: Unable to resolve class: org.omg.dds.demo.ShapeType]

        at org.apache.camel.language.ognl.OgnlExpression.evaluate(OgnlExpression.java:60)[132:org.apache.camel.camel-ognl:2.10.0.redhat-60024]

        at org.apache.camel.processor.SetBodyProcessor.process(SetBodyProcessor.java:38)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.fabric.FabricTraceProcessor.process(FabricTraceProcessor.java:81)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:334)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:308)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.Pipeline.process(Pipeline.java:117)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:336)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:189)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:155)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:142)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:92)[121:org.apache.camel.camel-core:2.10.0.redhat-60024]

        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_25]

        at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)[:1.7.0_25]

        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)[:1.7.0_25]

        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)[:1.7.0_25]

        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.7.0_25]

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_25]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_25]

        at java.lang.Thread.run(Thread.java:724)[:1.7.0_25]

      Caused by: ognl.MethodFailedException: Method "new" failed for object org.omg.dds.demo.ShapeType [java.lang.ClassNotFoundException: Unable to resolve class: org.omg.dds.demo.ShapeType]

        at ognl.OgnlRuntime.callConstructor(OgnlRuntime.java:1405)[211:org.apache.servicemix.bundles.ognl:3.0.5.1]

        at ognl.ASTCtor.getValueBody(ASTCtor.java:121)[211:org.apache.servicemix.bundles.ognl:3.0.5.1]

        at ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:212)[211:org.apache.servicemix.bundles.ognl:3.0.5.1]

        at ognl.SimpleNode.getValue(SimpleNode.java:258)[211:org.apache.servicemix.bundles.ognl:3.0.5.1]

        at ognl.Ognl.getValue(Ognl.java:494)[211:org.apache.servicemix.bundles.ognl:3.0.5.1]

        at ognl.Ognl.getValue(Ognl.java:458)[211:org.apache.servicemix.bundles.ognl:3.0.5.1]

        at org.apache.camel.language.ognl.OgnlExpression.evaluate(OgnlExpression.java:57)[132:org.apache.camel.camel-ognl:2.10.0.redhat-60024]

        ... 49 more

      Caused by: java.lang.ClassNotFoundException: Unable to resolve class: org.omg.dds.demo.ShapeType

        at ognl.OgnlRuntime.classForName(OgnlRuntime.java:1035)[211:org.apache.servicemix.bundles.ognl:3.0.5.1]

        at ognl.OgnlRuntime.callConstructor(OgnlRuntime.java:1365)[211:org.apache.servicemix.bundles.ognl:3.0.5.1]

        ... 55 more

      2014-02-17 11:20:53,115 | WARN  | blisher/src/data | GenericFileOnCompletion          | ent.file.GenericFileOnCompletion  151 | 121 - org.apache.camel.camel-core - 2.10.0.redhat-60024 | Rollback file strategy: org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@5c4dcb7c for file: GenericFile[C:\Users\Visumpoint\workspace\org.omg.dds.demo.ShapeType.publisher\src\data\CommandMessageDisallowPerson.xmi]

      2014-02-17 11:20:53,619 | ERROR | blisher/src/data | DefaultErrorHandler              | rg.apache.camel.util.CamelLogger  215 | 121 - org.apache.camel.camel-core - 2.10.0.redhat-60024 | Failed delivery for (MessageId: ID-Visumpoint-PC-58305-1392653850112-0-789 on ExchangeId: ID-Visumpoint-PC-58305-1392653850112-0-790). Exhausted after delivery attempt: 1 caught: org.apache.camel.ExpressionEvaluationException: ognl.MethodFailedException: Method "new" failed for object org.omg.dds.demo.ShapeType [java.lang.ClassNotFoundException: Unable to resolve class: org.omg.dds.demo.ShapeType]

        • 1. Re: ognl in camel-context.xml Unable to resolve custom class
          Claus Ibsen Master

          You can use dev:dynamic-import <bundleId> to do this. So if ognl is bundle id 167, then dev:dynamic-import 167

          • 2. Re: ognl in camel-context.xml Unable to resolve custom class
            Mason Tran Newbie

            Hello Claus,

             

            Thanks for your response, I tried it out, it was able to update the jar file and enable dynamic import for that bundle.  I already found another solution without adding dynamic import to ognl bundle.  Because if the container got delete or something has update the ognl bundle I will lose this dynamic import change.

             

            Instead of instantiating the class with ognl, I use the spring bean for instantiation and putting it into a HashMap using spring utility.

             

            xmlns:util="http://www.springframework.org/schema/util"

             

              <util:map map-class="java.util.HashMap" id="shapeMap">

                  <entry key="yellow" >

                      <bean class="org.omg.dds.demo.ShapeType" name="shape" ><constructor-arg value="yellow"/><constructor-arg value="1"/><constructor-arg value="1"/><constructor-arg value="1"/></bean>

                  </entry>

              </util:map>

             

            In the body I get the object.

             

                    <camel:setBody>

                    <camel:simple>bean:shapeMap.get("yellow")</camel:simple>

                    </camel:setBody>

             

            Thanks,

            Mason Tran

            1 of 1 people found this helpful