LinkageError: loader constraint violation: when resolving overridden method "org.eclipse.emf.ecore.xml.type.internal.XMLCalendar.getXMLSchemaType()Ljavax/xml/namespace/QName;"

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

LinkageError: loader constraint violation: when resolving overridden method "org.eclipse.emf.ecore.xml.type.internal.XMLCalendar.getXMLSchemaType()Ljavax/xml/namespace/QName;"

Mason Tran
Hello everyone,

I have been struggling with this LinkageError around (org.eclipse.emf.ecore.xml.type.internal.XMLCalendar) class for a few days now.  If anyone know what the problem might be please let me know.  Your help is greatly appreciated.  BTW this is working perfectly in my window environment, without any issue.  This LinkageError only happen when we deploy our bundle into the Linux environment.

Let me try to explain about my environment and my problems.

OS Version: Red Hat Enterprise Linux 6.2
Server Version: apache-karaf-2.2.11
JDK Version: jdk-7u25 Linux 64bit
OSGi framework: equinox


I have 2 bundles:
Bundle A - main bundle that package will the dependencies inside.
Bundle B - test bundle that has the camel route calling custom endpoint and bean in Bundle A.

Bundle A - pom.xml, this plug will go and grab all the dependencies and place them into "target/dependency" folder within this bundle.

Inside my target/dependency, there are a lot of different jar and including these also.

org.eclipse.emf.common-2.8.0.v20120606-0717.jar
org.eclipse.emf.ecore.xmi-2.8.0.v20120606-0717.jar
org.eclipse.emf.ecore-2.8.0.v20120606-0717.jar

This "XMLCalendar" is part of the org.eclipse.emf.ecore-2.8.0.v20120606-0717.jar file.  I believe some how maybe the Karaf environment also have it's own emf ecore files somewhere, but I am not able to find it.  I also try to export "org.eclipse.emf.ecore*" from the "maven-bundle-plugin", but it did not help.  I am not sure where the conflict is at, if anyone have any idea, please let me know.

     
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>2.3.7</version>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <Bundle-SymbolicName>gov.mace.snc.uc2.spring.rya</Bundle-SymbolicName>
            <Import-Package>
                    org.apache.camel;version="[2.10,2.11)",
                    org.apache.camel.impl;version="[2.10,2.11)",
                    org.apache.camel.builder;version="[2.10,2.11)",
                    org.apache.camel.model;version="[2.10,2.11)",
                    org.apache.camel.spring;version="[2.10,2.11)",
                    org.apache.camel.spi;version="[2.10,2.11)",          
                    !*
            </Import-Package>
            <Export-Package>
                    gov.mace.snc.internal.uc2.eam.seiwg.CommandMessage.util;version="1.0.0.201307061416",
                    gov.mace.snc.uc2.spring.rya;version="0.0.1-SNAPSHOT",
                    mvm.rya.accumulo;version="3.1.2-SNAPSHOT",
                    mvm.rya.rdftriplestore.inference;version="3.1.2-SNAPSHOT",
                    mvm.rya.rdftriplestore.namespace;version="3.1.2-SNAPSHOT",
                    org.apache.accumulo.core.client;version="1.4.0",
                    mvm.rya.camel.cbsail
            </Export-Package>
            <Embed-Dependency>*;scope=compile|runtime;inline=false</Embed-Dependency>
            <Embed-Directory>target/dependency</Embed-Directory>
            <Embed-Transitive>true</Embed-Transitive>
            <Embed-StripGroup>true</Embed-StripGroup>
          </instructions>
        </configuration>
      </plugin>


Karaf error log:
2013-09-13 17:56:16,736 | ERROR | leArtifacts.Copy | DefaultErrorHandler              | 64 - org.apache.camel.camel-core - 2.10.5 | Failed delivery for (MessageId: ID-99hrnap04-56200-1379109348838-0-123 on ExchangeId: ID-99hrnap04-56200-1379109348838-0-124). Exhausted after delivery attempt: 1 caught: org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[accessControlSystems/DeviceDetectionReportSuccessfulAccessAttemptResponse.xml]
org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[accessControlSystems/DeviceDetectionReportSuccessfulAccessAttemptResponse.xml]
        at org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1342)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.impl.DefaultExchange.setException(DefaultExchange.java:282)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:64)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:335)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:308)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:117)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:46)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:336)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:189)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:155)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:142)[64:org.apache.camel.camel-core:2.10.5]
        at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:92)[64:org.apache.camel.camel-core:2.10.5]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_25]
        at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)[:1.7.0_25]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)[:1.7.0_25]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)[:1.7.0_25]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.7.0_25]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_25]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_25]
        at java.lang.Thread.run(Thread.java:724)[:1.7.0_25]
Caused by: java.lang.LinkageError: loader constraint violation: when resolving overridden method "org.eclipse.emf.ecore.xml.type.internal.XMLCalendar.getXMLSchemaType()Ljavax/xml/namespace/QName;" the class loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) of the current class, org/eclipse/emf/ecore/xml/type/internal/XMLCalendar, and its superclass loader (instance of <bootloader>), have different Class objects for the type dar.getXMLSchemaType()Ljavax/xml/namespace/QName; used in the signature
        at org.eclipse.emf.ecore.xml.type.impl.XMLTypeFactoryImpl.createDateTime(XMLTypeFactoryImpl.java:267)
        at org.eclipse.emf.ecore.xml.type.impl.XMLTypeFactoryImpl.createDateTimeFromString(XMLTypeFactoryImpl.java:2316)
        at org.eclipse.emf.ecore.xml.type.impl.XMLTypeFactoryImpl.createFromString(XMLTypeFactoryImpl.java:1710)
        at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.createFromString(XMLHelperImpl.java:1615)
        at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHelperImpl.java:1156)
        at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2652)
        at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2642)
        at org.eclipse.emf.ecore.xmi.impl.XMLHandler.endElement(XMLHandler.java:1564)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:606)[:1.7.0_25]
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1742)[:1.7.0_25]
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2900)[:1.7.0_25]
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607)[:1.7.0_25]
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:489)[:1.7.0_25]
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835)[:1.7.0_25]
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)[:1.7.0_25]
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)[:1.7.0_25]
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210)[:1.7.0_25]
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568)[:1.7.0_25]
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:302)[:1.7.0_25]
        at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:175)
        at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:240)
        at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1505)
        at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1284)
        at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
        at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
        at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:406)
        at gov.mace.snc.uc2.spring.rya.MofToRdfParser.parse(MofToRdfParser.java:149)[108:gov.mace.snc.uc2.spring.rya:0.0.1.SNAPSHOT]
        at gov.mace.snc.uc2.spring.rya.RdfProcessor.parse(RdfProcessor.java:41)[108:gov.mace.snc.uc2.spring.rya:0.0.1.SNAPSHOT]
        at gov.mace.snc.uc2.spring.rya.RdfProcessor.process(RdfProcessor.java:62)[108:gov.mace.snc.uc2.spring.rya:0.0.1.SNAPSHOT]
        at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[64:org.apache.camel.camel-core:2.10.5]
        ... 43 more
2013-09-13 17:56:16,761 | WARN  | leArtifacts.Copy | GenericFileOnCompletion          | 64 - org.apache.camel.camel-core - 2.10.5 | Rollback file strategy: org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy@3542daea for file: GenericFile[/home/xmace/temp/data/sampleArtifacts.Copy/accessControlSystems/DeviceDetectionReportSuccessfulAccessAttemptResponse.xml]

Loading...