Forum Home » Fuse Distributions » Fuse ESB

Thread: ClassNotFoundException: org.apache.camel.ValidationException

 

Permlink Replies: 3 - Last Post: Jun 18, 2012 2:41 PM Last Post By: davsclaus Threads: [ Previous | Next ]
ddelizia

Posts: 6
Registered: 06/18/12
ClassNotFoundException: org.apache.camel.ValidationException
Posted: Jun 18, 2012 10:58 AM
  Click to reply to this thread Reply
Hello everybody,
i'm using Fuse IDE to create my route and in the camel context I added the following route:

<route>
<from uri="file:{{file.inbox}}?preMove=inprogress&amp;move=../.done"/>
<doTry>
<to uri="validator:classpath:idocOrderStatus.xsd"/>
<to uri="file:{{file.outbox.valid}}"/>
<doCatch>
<exception>org.apache.camel.ValidationException</exception>
<to uri="file:{{file.outbox.invalid}}"/>
</doCatch>
</doTry>
</route>

When I install this feature in the fuse esb i get the following error:

Exception in thread "SpringOsgiExtenderThread-10" org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route route7 at: >>> DoT
ry[[Tovalidator:classpath:idocOrderStatus.xsd, To, DoCatch[ null -> [To <<< in route: Route[[From[file:{{file.inbox}}?preMove=inprogres
s&move=../.... because of org.apache.camel.ValidationException
at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1157)
at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:110)
at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:240)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:911)
at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:358)
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:
132)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route7 at: >>> DoTry[[Tovalidator:classpath:idocOrderStatus.xsd, To, DoCatch[ null -> [T
o <<< in route: Route[[From[file:{{file.inbox}}?preMove=inprogress&move=../.... because of org.apache.camel.ValidationException
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:820)
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:165)
at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:685)
at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1683)
at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1468)
at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1360)
at org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:169)
at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1328)
at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:213)
at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:108)
... 10 more
Caused by: java.lang.ClassNotFoundException: org.apache.camel.ValidationException
at org.apache.camel.impl.DefaultClassResolver.resolveMandatoryClass(DefaultClassResolver.java:52)
at org.apache.camel.model.CatchDefinition.createExceptionClasses(CatchDefinition.java:254)
at org.apache.camel.model.CatchDefinition.createProcessor(CatchDefinition.java:91)
at org.apache.camel.model.TryDefinition.createProcessor(TryDefinition.java:90)
at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:444)
at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:183)
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:817)
... 21 more

I do not understend why I'm getting this error? There is anyway to import this class in the camel context? How should I do it?
davsclaus

Posts: 1,893
Registered: 10/14/08
Re: ClassNotFoundException: org.apache.camel.ValidationException
Posted: Jun 18, 2012 11:57 AM   in response to: ddelizia in response to: ddelizia
  Click to reply to this thread Reply
How do you package and deploy your application?
ddelizia

Posts: 6
Registered: 06/18/12
Re: ClassNotFoundException: org.apache.camel.ValidationException
Posted: Jun 18, 2012 2:03 PM   in response to: davsclaus in response to: davsclaus
  Click to reply to this thread Reply
I solved the problem adding org.apache.camel to the pom.xml

<Import-Package>*,org.apache.camel</Import-Package>

Thanks Anyway
davsclaus

Posts: 1,893
Registered: 10/14/08
Re: ClassNotFoundException: org.apache.camel.ValidationException
Posted: Jun 18, 2012 2:41 PM   in response to: ddelizia in response to: ddelizia
  Click to reply to this thread Reply
Yeah if you package as an OSGi bundle, then you need to ensure all the imports is included that you need.

The felix bundle plugin, can only scan spring XML files, and OSGi blueprint files, and based on <bean ... class="com.foo"/> that it finds in these XML files, auto include packages of those beans.

For all the rest you need to manually ensure its all there.

A different approach to osgi bundles, would be FAB
http://fuse.fusesource.org/bundle/overview.html