How to Deploy OSGI bundle of smooks in servicemix?

732 Views Asked by At

When i create simple maven project and run inside eclipse for smooks then it works fine but when i create osgi bundle for that and deploy it in servicemix then it shows following error...

I put my smook configuration file in servicemix_home/ConfigurationFiles/smook/......

Ex : org.milyn.SmooksException: Failed to apply processing unit [org.milyn.javabean.ext.PropertyChecker] to [org:milyn:smooks:unknowndoc:/smooks-resource-list/jb:bean/jb:wiring]. org.milyn.SmooksException: Failed to apply processing unit [org.milyn.javabean.ext.PropertyChecker] to [org:milyn:smooks:unknowndoc:/smooks-resource-list/jb:bean/jb:wiring]. at org.milyn.delivery.dom.SmooksDOMFilter.processVisitorException(SmooksDOMFilter.java:823) at org.milyn.delivery.dom.SmooksDOMFilter.access$700(SmooksDOMFilter.java:134) ... Caused by: org.milyn.cdr.SmooksConfigurationException: Bean class 'com.test.pojo.Order' not avilable on classpath. at org.milyn.javabean.ext.PropertyChecker.getBeanClass(PropertyChecker.java:97) at org.milyn.javabean.ext.PropertyChecker.getBeanType(PropertyChecker.java:78) at org.milyn.javabean.ext.PropertyChecker.visitBefore(PropertyChecker.java:47)

1

There are 1 best solutions below

0
On

Change Classloader Get current class loader from getClass().getClassLoader() and set in

Thread.currentThread().setContextClassLoader(classLoader);

and

smooks.setClassLoader(classLoader);