Hello. I'm getting classloader errors when using HAPI-OSGI (hapi-osgi-base)
which is installed with the Camel-HL7 feature. I suspect the problem is that
hapi-osgi-base embeds an older version of Xerces but I'm not familiar enough
with OSGi to be confident.  My environment: ServiceMix 4.4.2, Camel 2.8.5,
JDK 1.6U7, WinXP. 

My route:

        <bean id="SimpleTranformer" 
class="simple.messaging.app.SimpleTransformer"
/>
        <camelContext trace="false" id="blueprintContext"
xmlns="http://camel.apache.org/schema/blueprint";>
                <route id="simpleRoute">
                        <from uri="file:src/input" />
                        <bean ref="SimpleTranformer" method="transform" />
                        <to uri="file://src/output" />
                </route>
        </camelContext>

SimpleTransformer.tranform():

        Message message = HL7Converter.toMessage(body);
        XMLParser xmlParser = new DefaultXMLParser();  // exception thrown here
(line 16)
        return xmlParser.encode(message);

Produces the following runtime exception:

        Caused by: java.lang.LinkageError: loader constraint violation: when
resolving method
"org.apache.xerces.parsers.DOMParser.<init>(Lorg/apache/xerces/xni/parser/XMLParserConfiguration;)V"
the class loader (instance of
org/apache/felix/framework/ModuleImpl$ModuleClassLoaderJava5) of the current
class, ca/uhn/hl7v2/parser/XMLParser, and the class loader (instance of
<bootloader>) for resolved class, org/apache/xerces/parsers/DOMParser, have
different Class objects for the type
org/apache/xerces/xni/parser/XMLParserConfiguration used in the signature
                at
ca.uhn.hl7v2.parser.XMLParser.<init>(XMLParser.java:108)[138:ca.uhn.hapi.osgi-base:1.2]
                at
ca.uhn.hl7v2.parser.XMLParser.<init>(XMLParser.java:99)[138:ca.uhn.hapi.osgi-base:1.2]
                at
ca.uhn.hl7v2.parser.DefaultXMLParser.<init>(DefaultXMLParser.java:77)[138:ca.uhn.hapi.osgi-base:1.2]
                at
simple.messaging.app.SimpleTransformer.transform(SimpleTransformer.java:16)[160:camel-blueprint:1.0.0.SNAPSHOT]





--
View this message in context: 
http://servicemix.396122.n5.nabble.com/Classloader-error-when-using-HAPI-in-ServiceMix-tp5714801.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to