Hi,

I assume you're using JBI packaging with SMX4, then you can add osgi bundle reference to your xbean.xml like
<classpath>
  <library>osgi:org.apache.camel.camel-core</library>
</classpath>

You can take a look at [1] to get more details, the "New in Servicemix 4.2.0" chapter.

Btw, if you deploy camel router in SMX4(which is OSGi container basically), you actually needn't use JBI packaging, deploy it as OSGi bundle directly should be ok.

Freeman

On 2011-8-19, at 下午3:58, Sorin Silaghi wrote:

Hello,


I am trying to add a GenericFileProcessStrategy implementation to my camel route in servicemix but I can't solve a dependency problem. I keep getting a ClassNotFoundException for GenericFileProcessStrategy. I tried to add camel-core as a dependency to my SU but that doesn't seem to
help. Anybody know what would be the proper way to do this?


Below is my camel-context file:

 <bean id="testStrategy" class="org.test.TestStrategy" />

 <camelContext xmlns="http://camel.apache.org/schema/spring";
id="camelContext">

   <route id="ORDERS">
     <from uri="file://data/edigrid/
endpoints/DPD-in?processStrategy=#testStrategy"/>
     <to uri="file://data/edigrid/endpoints/DPD-out"/>
   </route>
 </camelContext>


            And here is the exception I get:

Caused by: java.lang.NoClassDefFoundError:
org/apache/camel/component/file/GenericFileProcessStrategy
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
   at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java: 142)
   at
org.apache.xbean.classloader.JarFileClassLoader.access $200(JarFileClassLoader.java:48)
   at
org.apache.xbean.classloader.JarFileClassLoader $6.run(JarFileClassLoader.java:272)
   at java.security.AccessController.doPrivileged(Native Method)
   at
org .apache .xbean .classloader.JarFileClassLoader.findClass(JarFileClassLoader.java:224)
   at
org .apache .xbean .classloader .MultiParentClassLoader.loadClass(MultiParentClassLoader.java:200)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
   at org.springframework.util.ClassUtils.forName(ClassUtils.java:257)
   at
org .springframework .beans .factory .support .BeanDefinitionReaderUtils .createBeanDefinition(BeanDefinitionReaderUtils.java:63)
   at
org .springframework .beans .factory .xml .BeanDefinitionParserDelegate .createBeanDefinition(BeanDefinitionParserDelegate.java:616)
   at
org .springframework .beans .factory .xml .BeanDefinitionParserDelegate .parseBeanDefinitionElement(BeanDefinitionParserDelegate.java:472)
   ... 82 more
Caused by: java.lang.ClassNotFoundException:
org.apache.camel.component.file.GenericFileProcessStrategy in classloader org .apache.xbean.spring.context.FileSystemXmlApplicationContext@1abe751
   at
org .apache .xbean .classloader .MultiParentClassLoader.loadClass(MultiParentClassLoader.java:206)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
   ... 95 more



Best regards,
                      Sorin.

---------------------------------------------
Freeman Fang

FuseSource
Email:[email protected]
Web: fusesource.com
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com









Reply via email to