java.lang.LinkageError: loader constraint violation in Wildfly 8.2.0
jose.romero Apr 22, 2016 8:07 AMHello,
I'm trying to remotelly call an EJB deployed in a Wildfly 8.2.0 (called EJBtest2) from another EJB deployed in a different wildfly installed in a different host (called EJBtest1). I have a servlet that starts the first EJB (EJBtest1) and from this EJB, I'm trying to make a remote call to the second EJB (EJBtest2).
Wildlfy where EJBtest2 is deployed starts without problems but, when I try to start the Wildfly that contains EJBtest1, the following exception is launched:
13:35:04,794 ERROR [stderr] (MSC service thread 1-2) javax.ejb.EJBException: JBAS014580: Unexpected Error
13:35:04,795 ERROR [stderr] (MSC service thread 1-2) at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:187)
13:35:04,795 ERROR [stderr] (MSC service thread 1-2) at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:275)
13:35:04,795 ERROR [stderr] (MSC service thread 1-2) at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:340)
13:35:04,795 ERROR [stderr] (MSC service thread 1-2) at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:239)
13:35:04,795 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
13:35:04,796 ERROR [stderr] (MSC service thread 1-2) at org.jboss.as.ejb3.remote.EJBRemoteTransactionPropagatingInterceptor.processInvocation(EJBRemoteTransactionPropagatingInterceptor.java:79)
13:35:04,796 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
13:35:04,796 ERROR [stderr] (MSC service thread 1-2) at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
13:35:04,796 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
13:35:04,796 ERROR [stderr] (MSC service thread 1-2) at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:43)
13:35:04,796 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
13:35:04,796 ERROR [stderr] (MSC service thread 1-2) at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:95)
13:35:04,797 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
13:35:04,797 ERROR [stderr] (MSC service thread 1-2) at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)
13:35:04,797 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
13:35:04,797 ERROR [stderr] (MSC service thread 1-2) at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59)
13:35:04,797 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
13:35:04,797 ERROR [stderr] (MSC service thread 1-2) at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
13:35:04,797 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
13:35:04,798 ERROR [stderr] (MSC service thread 1-2) at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55)
13:35:04,798 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
13:35:04,798 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
13:35:04,798 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
13:35:04,798 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)
13:35:04,798 ERROR [stderr] (MSC service thread 1-2) at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:448)
13:35:04,798 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)
13:35:04,798 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
13:35:04,799 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)
13:35:04,799 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
13:35:04,799 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
13:35:04,799 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
13:35:04,799 ERROR [stderr] (MSC service thread 1-2) at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:185)
13:35:04,799 ERROR [stderr] (MSC service thread 1-2) at org.jboss.as.ejb3.remote.LocalEjbReceiver.processInvocation(LocalEjbReceiver.java:245)
13:35:04,799 ERROR [stderr] (MSC service thread 1-2) at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:184)
13:35:04,800 ERROR [stderr] (MSC service thread 1-2) at org.jboss.ejb.client.EJBObjectInterceptor.handleInvocation(EJBObjectInterceptor.java:58)
13:35:04,800 ERROR [stderr] (MSC service thread 1-2) at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:186)
13:35:04,800 ERROR [stderr] (MSC service thread 1-2) at org.jboss.ejb.client.EJBHomeInterceptor.handleInvocation(EJBHomeInterceptor.java:83)
13:35:04,800 ERROR [stderr] (MSC service thread 1-2) at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:186)
13:35:04,800 ERROR [stderr] (MSC service thread 1-2) at org.jboss.ejb.client.TransactionInterceptor.handleInvocation(TransactionInterceptor.java:42)
13:35:04,800 ERROR [stderr] (MSC service thread 1-2) at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:186)
13:35:04,800 ERROR [stderr] (MSC service thread 1-2) at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:125)
13:35:04,801 ERROR [stderr] (MSC service thread 1-2) at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:186)
13:35:04,801 ERROR [stderr] (MSC service thread 1-2) at org.jboss.ejb.client.EJBInvocationHandler.sendRequestWithPossibleRetries(EJBInvocationHandler.java:253)
13:35:04,801 ERROR [stderr] (MSC service thread 1-2) at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:198)
13:35:04,801 ERROR [stderr] (MSC service thread 1-2) at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:181)
13:35:04,801 ERROR [stderr] (MSC service thread 1-2) at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:144)
13:35:04,801 ERROR [stderr] (MSC service thread 1-2) at com.sun.proxy.$Proxy26.start(Unknown Source)
13:35:04,801 ERROR [stderr] (MSC service thread 1-2) at es.jromero.testejb.TestEJBSevlet.init(TestEJBSevlet.java:22)
13:35:04,802 ERROR [stderr] (MSC service thread 1-2) at javax.servlet.GenericServlet.init(GenericServlet.java:244)
13:35:04,802 ERROR [stderr] (MSC service thread 1-2) at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117)
13:35:04,802 ERROR [stderr] (MSC service thread 1-2) at org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:79)
13:35:04,802 ERROR [stderr] (MSC service thread 1-2) at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103)
13:35:04,802 ERROR [stderr] (MSC service thread 1-2) at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:220)
13:35:04,802 ERROR [stderr] (MSC service thread 1-2) at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:125)
13:35:04,802 ERROR [stderr] (MSC service thread 1-2) at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:508)
13:35:04,802 ERROR [stderr] (MSC service thread 1-2) at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:88)
13:35:04,803 ERROR [stderr] (MSC service thread 1-2) at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start(UndertowDeploymentService.java:72)
13:35:04,803 ERROR [stderr] (MSC service thread 1-2) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
13:35:04,803 ERROR [stderr] (MSC service thread 1-2) at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
13:35:04,803 ERROR [stderr] (MSC service thread 1-2) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
13:35:04,803 ERROR [stderr] (MSC service thread 1-2) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
13:35:04,803 ERROR [stderr] (MSC service thread 1-2) at java.lang.Thread.run(Thread.java:745)
13:35:04,804 ERROR [stderr] (MSC service thread 1-2) Caused by: java.lang.LinkageError: loader constraint violation: when resolving method "org.jboss.ejb.client.EJBClientContext.registerConnection(Lorg/jboss/remoting3/Connection;)V" the class loader (instance of org/jboss/modules/ModuleClassLoader) of the current class, org/jboss/naming/remote/client/ejb/RemoteNamingStoreEJBClientHandler, and the class loader (instance of org/jboss/modules/ModuleClassLoader) for the method's defining class, org/jboss/ejb/client/EJBClientContext, have different Class objects for the type org/jboss/remoting3/Connection used in the signature
13:35:04,804 ERROR [stderr] (MSC service thread 1-2) at org.jboss.naming.remote.client.ejb.RemoteNamingStoreEJBClientHandler.associate(RemoteNamingStoreEJBClientHandler.java:78)
13:35:04,804 ERROR [stderr] (MSC service thread 1-2) at org.jboss.naming.remote.protocol.v1.RemoteNamingStoreV1.<init>(RemoteNamingStoreV1.java:71)
13:35:04,804 ERROR [stderr] (MSC service thread 1-2) at org.jboss.naming.remote.protocol.v1.VersionOne.getRemoteNamingStore(VersionOne.java:50)
13:35:04,804 ERROR [stderr] (MSC service thread 1-2) at org.jboss.naming.remote.protocol.Versions.getRemoteNamingStore(Versions.java:55)
13:35:04,804 ERROR [stderr] (MSC service thread 1-2) at org.jboss.naming.remote.client.RemoteContextFactory.createVersionedStore(RemoteContextFactory.java:73)
13:35:04,804 ERROR [stderr] (MSC service thread 1-2) at org.jboss.naming.remote.client.HaRemoteNamingStore.failOverSequence(HaRemoteNamingStore.java:202)
13:35:04,805 ERROR [stderr] (MSC service thread 1-2) at org.jboss.naming.remote.client.HaRemoteNamingStore.namingStore(HaRemoteNamingStore.java:149)
13:35:04,805 ERROR [stderr] (MSC service thread 1-2) at org.jboss.naming.remote.client.HaRemoteNamingStore.namingOperation(HaRemoteNamingStore.java:130)
13:35:04,805 ERROR [stderr] (MSC service thread 1-2) at org.jboss.naming.remote.client.HaRemoteNamingStore.lookup(HaRemoteNamingStore.java:272)
13:35:04,805 ERROR [stderr] (MSC service thread 1-2) at org.jboss.naming.remote.client.RemoteContext.lookup(RemoteContext.java:87)
13:35:04,805 ERROR [stderr] (MSC service thread 1-2) at org.jboss.naming.remote.client.RemoteContext.lookup(RemoteContext.java:129)
13:35:04,805 ERROR [stderr] (MSC service thread 1-2) at javax.naming.InitialContext.lookup(InitialContext.java:417)
13:35:04,830 ERROR [stderr] (MSC service thread 1-2) at javax.naming.InitialContext.lookup(InitialContext.java:417)
13:35:04,830 ERROR [stderr] (MSC service thread 1-2) at es.jromero.ejbtest.EJBtest1.start(EJBtest1.java:37)
13:35:04,831 ERROR [stderr] (MSC service thread 1-2) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
13:35:04,831 ERROR [stderr] (MSC service thread 1-2) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
13:35:04,831 ERROR [stderr] (MSC service thread 1-2) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
13:35:04,831 ERROR [stderr] (MSC service thread 1-2) at java.lang.reflect.Method.invoke(Method.java:497)
13:35:04,831 ERROR [stderr] (MSC service thread 1-2) at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)
13:35:04,831 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
13:35:04,831 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
13:35:04,832 ERROR [stderr] (MSC service thread 1-2) at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
13:35:04,832 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
13:35:04,832 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407)
13:35:04,832 ERROR [stderr] (MSC service thread 1-2) at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82)
13:35:04,832 ERROR [stderr] (MSC service thread 1-2) at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)
13:35:04,832 ERROR [stderr] (MSC service thread 1-2) at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
13:35:04,832 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
13:35:04,833 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)
13:35:04,833 ERROR [stderr] (MSC service thread 1-2) at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
13:35:04,833 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
13:35:04,833 ERROR [stderr] (MSC service thread 1-2) at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)
13:35:04,833 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
13:35:04,833 ERROR [stderr] (MSC service thread 1-2) at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)
13:35:04,833 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
13:35:04,834 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407)
13:35:04,834 ERROR [stderr] (MSC service thread 1-2) at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:55)
13:35:04,834 ERROR [stderr] (MSC service thread 1-2) at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)
13:35:04,834 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
13:35:04,834 ERROR [stderr] (MSC service thread 1-2) at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)
13:35:04,834 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
13:35:04,834 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
13:35:04,834 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
13:35:04,835 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
13:35:04,835 ERROR [stderr] (MSC service thread 1-2) at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53)
13:35:04,835 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
13:35:04,835 ERROR [stderr] (MSC service thread 1-2) at org.jboss.as.ejb3.component.interceptors.NonPooledEJBComponentInstanceAssociatingInterceptor.processInvocation(NonPooledEJBComponentInstanceAssociatingInterceptor.java:59)
13:35:04,835 ERROR [stderr] (MSC service thread 1-2) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)
13:35:04,835 ERROR [stderr] (MSC service thread 1-2) at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:273)
13:35:04,835 ERROR [stderr] (MSC service thread 1-2) ... 60 more
I'm using Eclipse Luna SR2 over a CentOS7 virtual machine; I also have a deployment descriptor that generates an EAR called EJBtest1EAR and deployes it in the Wildlfy. The libraries that I'm using in my client part are:
jboss-ejb-api_3.2_spec-1.0.0.Final.jar
jboss-ejb-client-2.0.1.Final.jar
jboss-logging-3.1.4.GA.jar
jboss-marshalling-1.4.6.Final.jar
jboss-marshalling-1.4.9.Final.jar
jboss-marshalling-river-1.4.6.Final.jar
jboss-marshalling-river-1.4.9.Final.jar
jboss-remote-naming-2.0.1.Final.jar
jboss-remoting-4.0.3.Final.jar
jboss-remoting-4.0.6.Final.jar
jboss-sasl-1.0.4.Final.jar
jboss-transaction-api_1.2_spec-1.0.0.Final.jar
xnio-api-3.2.2.Final.jar
xnio-api-3.3.0.Final.jar
xnio-nio-3.2.2.Final.jar
xnio-nio-3.3.0.Final.jar
If I generate a Java project and try to call the remote EJB with the same code than the one in EJBtest1, it works; what I'm unable to do is to communicate one EJB with the other.
Any suggestion will be appreciated because I'm stuck with this problem
I have included my source files:
EJBRemoteClient: Java standalone application that makes a remote call to the EJBtest2 (works)
EJBtest1: EJB that calls EJBtest2 (doesn't work)
EJBtest1Remote: Remote interface for EJBtest1
EJBtest2: Second EJB that receives the call from EJBtest1
TestEJBSevlet: Servlet that launches the EJBtest1
EJBtest2Remote: Remote interface for the EJBtest2
Thanks
Jose
-
EJBtest1Remote.java 185 bytes
-
EJBtest2.java 617 bytes
-
TestEJBSevlet.java 832 bytes
-
EJBtest2Remote.java 195 bytes
-
EJBtest1.java 1.8 KB
-
EjbRemoteClient.java 1.5 KB