Hi fellows!
I am following some scarce resources in the web to enable my *JBI
Service*to use Smooks to unmarshal a CSV straight to XML (migrating
from JBossESB).
I've installed the Smooks OSGi feature in my ServiceMix (4.4.1 fuse-01-13)
instance with:
features:addUrl mvn:org.milyn/milyn-smooks-all/1.5/xml/features *(not the
SNAPSHOT)*
features:install smooks
at first I just added my smooks-config.xml and the SmooksDataFormat
declaration in my camel-context.xml:
<bean id="smooks"
class="org.milyn.smooks.camel.dataformat.SmooksDataFormat">
<constructor-arg><value>META-INF/resources/normalization/smooks-config.xml</value></constructor-arg>
</bean>
then I packaged the SA and deployed to SMX, which gave me a
ClassNotFoundException: org.milyn.smooks.camel.dataformat.SmooksDataFormat,
so I figured I should add the smooks dependency to my pom.xml:
<dependency>
<groupId>org.milyn</groupId>
<artifactId>milyn-smooks-camel</artifactId>
<version>1.5</version>
</dependency>
packaged and deployed again, and now I am afraid I'm stuck with a
classloading issue: ClassCastException: org.milyn.SmooksOSGIFactory cannot
be cast to org.milyn.SmooksFactory (SmooksOSGIFactory implements
SmooksFactory).
I guess the SmooksOSGIFactory has a diferent classloader then the current
classloader of my JBI Service, thus throwing the ClassCastException. Am I
right? How do I fix this? I would like to avoid packaging all smooks
dependencies in my SU/SA.
Thanks,
*Henrique Viecili*
Myreks
Resources:
http://blog.smooks.org/2011/02/19/smooks-osgi-revisited/
http://blog.smooks.org/2010/02/22/apache-camel-smooks/
https://github.com/smooks/smooks/tree/v1.4/smooks-examples/camel