Error java.lang.LinkageError when using XMLconvert Service (

Posted by Admin on 22-Dec-2009 13:18

When I insert the XMLconvert service into an ESB container, i receive the following error when starting the Container:


java.lang.LinkageError: loader constraints violated when linking org/xml/sax/ErrorHandler class
     at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:786)
     at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:696)
     at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:471)
     at org.apache.log4j.LogManager.<clinit>(LogManager.java:125)
     at org.apache.log4j.Logger.getRootLogger(Logger.java:136)
     at com.sonicsw.xqimpl.util.log.XQLog4jConfigurator.isConfigured(XQLog4jConfigurator.java:126)
     at com.sonicsw.xqimpl.util.log.XQLog4jConfigurator.setConfiguration(XQLog4jConfigurator.java:66)
     at com.sonicsw.xqimpl.service.XQContainer.initLog4j(XQContainer.java:444)
     at com.sonicsw.xqimpl.service.XQContainer.init(XQContainer.java:373)
     at com.sonicsw.mf.framework.agent.AbstractMBean.<init>(AbstractMBean.java:293)
     at com.sonicsw.mf.framework.agent.ComponentMBean.<init>(ComponentMBean.java:170)
     at com.sonicsw.mf.framework.agent.ContainerImpl.internalLoadComponent(ContainerImpl.java:3374)
     at com.sonicsw.mf.framework.agent.ContainerImpl.loadComponent(ContainerImpl.java:1305)
     at com.sonicsw.mf.framework.agent.ContainerImpl.loadConfiguredComponent(ContainerImpl.java:473)
     at com.sonicsw.mf.framework.agent.ContainerImpl.loadConfiguredComponents(ContainerImpl.java:4107)
     at com.sonicsw.mf.framework.agent.ContainerImpl.loadAllConfiguredComponents(ContainerImpl.java:3943)
     at com.sonicsw.mf.framework.agent.ContainerImpl.bootFramework(ContainerImpl.java:2232)
     at com.sonicsw.mf.framework.agent.ContainerImpl.<init>(ContainerImpl.java:313)
     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
     at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
     at com.sonicsw.mf.framework.agent.ci.Agent.<init>(Agent.java:212)
     at com.sonicsw.mf.framework.agent.ci.Agent$1.run(Agent.java:93)
     at java.lang.Thread.run(Thread.java:595)

I added the following jar files to the resources of the ESB container:

sonicfs:///workspace/XMLConvert/external/xflat.jar
sonicfs:///workspace/XMLConvert/lib/custom-services-classes.jar
sonicfs:///Resources/lib/activation.jar
sonicfs:///Resources/lib/esbadptr.jar
sonicfs:///Resources/lib/mail.jar
sonicfs:///Resources/lib/soap.jar
sonicfs:///Resources/lib/servlet.jar

Any Idea what I am doing wrong?

Regards,

Mike

All Replies

Posted by Bill Wood on 23-Dec-2009 13:48

I assume this is the service you got from javascript:;.   This seems to have been written a few years ago, so it has probably not been updated.  There are two things I would try:

1. Don't add the sonicfs:///Resources/lib files to the Container classpath.  The list seems to be ones that already exist in ESBContainer.car.

2. I'd add the other classes to the serviceType classpath and not to the container.  (The serviceType classpath was added in 7.6)

sonicfs:///workspace/XMLConvert/external/xflat.jar
sonicfs:///workspace/XMLConvert/lib/custom-services-classes.jar

These are just guesses.

Posted by Admin on 23-Dec-2009 14:59

I tried it, but still get the linkage error.

Adding the classes to the serviceType classpath does not seem to work- when I add the classes there they seem to not get loaded. Should i specify the classes at the type, instance or container tab (I can't find anything about this in the documentation) ?

Is there any other service type to easily convert a csv file to xml?

Posted by Bill Wood on 23-Dec-2009 15:58

yetanotherfool wrote:

Should i specify the classes at the type, instance or container tab (I can't find anything about this in the documentation) ?


You should specify the serviceType.   I don't know if you are looking in the documentation books, or in Workbench online help.  Most of the developer help is in Workbench.   Look up "ESB classloader hierarchy " at

As to why the service is not loading, it is probably related to what you are putting in the classpath.  My understanding of the java.lang.LinkageError is that the error occurs when two classloaders have loaded the same class with different signatures.  ie: you have the same class twice in your CLASSPATH, but the classes are different (usually different versions).

Usually, the reason is that you have included a jar file in your classpath that is in the ESB Container's .car file.

You might try rebuilding the servicetype.

BTW...I personally have no experience with CVS-to-XML services.  I'd try SOA-Knowledge.

This thread is closed