Bug 1213749 - Camel throwing java.lang.LinkageError for Remote Query when running in EAP
Summary: Camel throwing java.lang.LinkageError for Remote Query when running in EAP
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Data Grid 6
Classification: JBoss
Component: Camel-JBossDataGrid
Version: 6.5.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ER4
: 6.5.0
Assignee: Adrian Nistor
QA Contact: Martin Gencur
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-21 08:33 UTC by Martin Gencur
Modified: 2015-06-23 12:24 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-06-23 12:24:42 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
full-stacktrace (15.57 KB, text/plain)
2015-04-21 08:35 UTC, Martin Gencur
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker ISPN-5501 0 Major Resolved Camel throwing java.lang.LinkageError for Remote Query when running in EAP 2016-05-24 14:00:14 UTC

Description Martin Gencur 2015-04-21 08:33:59 UTC
I'm running InfinispanRemoteQueryProducerIT inside EAP and root cause looks like this (full stacktrace attached:
Caused by: java.lang.LinkageError: loader constraint violation: loader (instance of org/jboss/modules/ModuleClassLoader) previously initiated loading for a different type with name "org/infinispan/query/dsl/QueryFactory"
	at org.apache.camel.component.infinispan.InfinispanRemoteQueryProducerIT$5$1.build(InfinispanRemoteQueryProducerIT.java:212) [camel-jbossdatagrid-tests.jar:6.5.0.ER2-redhat-1]
	at org.apache.camel.component.infinispan.InfinispanOperation$Operation.getQuery(InfinispanOperation.java:114) [camel-jbossdatagrid.jar:6.5.0.ER2-redhat-1]
	at org.apache.camel.component.infinispan.InfinispanOperation$Operation$5.execute(InfinispanOperation.java:84) [camel-jbossdatagrid.jar:6.5.0.ER2-redhat-1]
	at org.apache.camel.component.infinispan.InfinispanOperation.process(InfinispanOperation.java:39) [camel-jbossdatagrid.jar:6.5.0.ER2-redhat-1]
	at org.apache.camel.component.infinispan.InfinispanProducer.process(InfinispanProducer.java:42) [camel-jbossdatagrid.jar:6.5.0.ER2-redhat-1]
	at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) [camel-core.jar:2.12.0.redhat-610379]
	... 124 more


I'm using jboss-deployment-structure.xml:
<jboss-deployment-structure>
    <deployment>
        <dependencies>
            <module name="org.infinispan" slot="${datagrid.slot}" />
            <module name="org.jgroups" slot="${datagrid.slot}" />
            <module name="org.infinispan.client.hotrod" slot="${datagrid.slot}" />
            <module name="org.infinispan.protostream" slot="${datagrid.slot}" />
            <module name="org.infinispan.query.remote.client" slot="${datagrid.slot}" />
            <module name="org.infinispan.protostream.sample-domain-definition" slot="${datagrid.slot}" />
            <module name="org.infinispan.protostream.sample-domain-implementation" slot="${datagrid.slot}" />
        </dependencies>
    </deployment>
</jboss-deployment-structure>

and libraries such as camel-core, camel-jbossdatagrid are deployed inside the application.

Comment 1 Martin Gencur 2015-04-21 08:35:36 UTC
Created attachment 1016741 [details]
full-stacktrace

Comment 3 Ion Savin 2015-04-22 14:07:24 UTC
You probably need also:

<module name="org.infinispan.query.dsl" slot="${datagrid.slot}" />

Comment 4 Martin Gencur 2015-04-22 14:15:53 UTC
Maybe, but it does not help in this case. I tried that.

Comment 5 Martin Gencur 2015-04-29 16:12:32 UTC
The camel-jbossdatagrid component requires both infinispan-embedded and infinispan-remote on classpath and when I package these libraries in the war file, the deployment into EAP fails due to https://bugzilla.redhat.com/show_bug.cgi?id=1175272. I'm not able to run the tests, logically. The workaround would be to use individual jar files (the old way), and not uber-jars.

Comment 6 Martin Gencur 2015-04-30 07:03:22 UTC
Yay! 

I was able to run all tests for camel-jbossdatagrid in EAP 6.4, including remote query and custom even listeners.

The following set of dependencies has to be used instead of uber-jars (so it's a workaround):

camel-jbossdatagrid.jar
camel-core.jar
infinispan-commons.jar
infinispan-core.jar
jboss-marshalling.jar
jboss-marshalling-river.jar
jgroups.jar
jboss-logging.jar
jboss-transaction-api_1.1_spec.jar
infinispan-client-hotrod.jar
commons-pool.jar
infinispan-query-dsl.jar
infinispan-remote-query-client.jar
protostream.jar

Comment 7 Ion Savin 2015-04-30 08:15:44 UTC
Would you mind opening a PR if you already have the changes ready and tested?

Comment 8 Martin Gencur 2015-04-30 08:18:34 UTC
What PR? This still needs to be fixed as the preferred way is to use uber-jars. What I described is basically a workaround. I have the modified tests in my local branch but don't want to push them to github.


Note You need to log in before you can comment on or make changes to this bug.