9 Replies Latest reply on Apr 28, 2016 7:40 AM by Jose Romero

    java.lang.LinkageError: loader constraint violation in Wildfly 8.2.0

    Jose Romero Newbie

      Hello,

       

      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

        • 1. Re: java.lang.LinkageError: loader constraint violation in Wildfly 8.2.0
          Tomaz Cerar Master

          Jose Romero wrote:

          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

           

          For start, make sure you don't have duplicate jars of different versions on your client classpath.

          • 2. Re: java.lang.LinkageError: loader constraint violation in Wildfly 8.2.0
            Jose Romero Newbie

            Sorry, I have posted the libraries under my lib folder but they are not all included in the classpath (I have tried different versions of some libraries to try to solve the problem). The libraries I have in my classpath 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-remote-naming-2.0.1.Final.jar

            jboss-sasl-1.0.4.Final.jar

            jboss-transaction-api_1.2_spec-1.0.0.Final.jar

            jboss-marshalling-1.4.9.Final.jar

            jboss-marshalling-river-1.4.9.Final.jar

            jboss-remoting-4.0.6.Final.jar

            xnio-api-3.3.0.Final.jar

            xnio-nio-3.3.0.Final.jar

             

            with no duplicated jars.

             

            Thanks for the answer

            • 3. Re: java.lang.LinkageError: loader constraint violation in Wildfly 8.2.0
              Jose Romero Newbie

              I have installed Wildfly 10.0.0 Final and the same error occurs.

               

              Any suggestion please?

              • 4. Re: java.lang.LinkageError: loader constraint violation in Wildfly 8.2.0
                Radoslav Husar Master

                The versions of the Jars seem to be quite off. Where is that set of jars coming from?

                 

                Just use instead the client uber jar to solve problem with different versions: see wildfly-8.2.0.Final/bin/client/jboss-client.jar

                • 5. Re: java.lang.LinkageError: loader constraint violation in Wildfly 8.2.0
                  Jose Romero Newbie

                  Hi,

                   

                  I,ve replaced all my jars with jboss-client.jar and the same error happens. I've tried to call the EJB outside wildfly and the code works with this jar. One thing I've tried is changing the value of the property "jboss.naming.client.ejb.context" that I'm passing to the InitialContext to false; after that, the following error is launched:

                  10:24:04,704 ERROR [stderr] (MSC service thread 1-1) java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:EJBtest1EAR, moduleName:EJBtest2, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@761d8a87

                   

                  Maybe is a problem in the properties of the InitialContext, I have the following ones:

                  Properties jndiProps = new Properties();

                    jndiProps.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");

                    jndiProps.put(Context.PROVIDER_URL, "http-remoting://192.168.0.209:8080");

                    jndiProps.put(Context.SECURITY_PRINCIPAL, "remote");

                    jndiProps.put(Context.SECURITY_CREDENTIALS, "remotepwd");         

                    jndiProps.put("jboss.naming.client.ejb.context", true);

                    return new InitialContext(jndiProps);

                   

                  Any other idea?

                   

                  Thanks

                  • 6. Re: java.lang.LinkageError: loader constraint violation in Wildfly 8.2.0
                    Radoslav Husar Master
                    I,ve replaced all my jars with jboss-client.jar and the same error happens. I've tried to call the EJB outside wildfly and the code works with this jar.

                    Wait, you were talking about a client but did you not mean an external client (i.e. separate Java SE process) but client which is within the WildFly app server? In that case you do not need and should not bring in any jars in your deployment -- you should use the container managed ones.

                    • 7. Re: java.lang.LinkageError: loader constraint violation in Wildfly 8.2.0
                      Jose Romero Newbie

                      Yes,

                       

                      what I've got is an EJB deployed in a wildfly that is installed in a host  (the "client" one) and another EJB deployed in another wildfly installed in another host and I'm trying to communicate remotely the first EJB with the second (both hosts are virtual machines over Oracle Virtual Box).  If instead of using an EJB as "client" I use a Java standalone application outside Wildfly, this standalone application is able to communicate with the second EJB remotely.

                      Now I'm just using the jboss-client.jar in my EAR as you have suggested, I cannot remove it from my EAR because a ClassNotFound exception is raised (java.lang.ClassNotFoundException: org.jboss.naming.remote.client.InitialContextFactory from [Module "deployment.EJBtest1EAR.ear.EJBtest1.jar:main" from Service Module Loader]

                      • 8. Re: java.lang.LinkageError: loader constraint violation in Wildfly 8.2.0
                        Radoslav Husar Master

                        Ok then, if you are invoking from App server to App server, you should use jboss-ejb-client.xml file to configure the client and remote ends. See this article for AS7 which might need a bit of tweaking for WF8:

                         

                        How to call EJBs from another JBoss AS 7 instance

                        • 9. Re: java.lang.LinkageError: loader constraint violation in Wildfly 8.2.0
                          Jose Romero Newbie

                          Thanks,

                           

                          I've read the article and thanks to it, I've found the following article

                          EJB invocations from a remote server instance - WildFly 8 - Project Documentation Editor

                          that explains how to do in WF8.

                          I've followed what the article says but, I still could not call remotelly the EJB. Now I have problems in the JNDI name of the remote EJB, if I use the one that comes in the article, in my case:

                          ejb:EJBtest1EAR/EJBtest2//EJBtest2!es.jromero.ejbtest.EJBtest2Remote


                          The following error is shown:

                          java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:EJBtest1EAR, moduleName:EJBtest2, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@537b8aa8


                          If I use the JNDI name that works when using http-remoting in my standalone client:

                          EJBtest1EAR/EJBtest2/EJBtest2!es.jromero.ejbtest.EJBtest2Remote

                           

                          I have the following error:

                          javax.naming.NameNotFoundException: EJBtest1EAR/EJBtest2/EJBtest2!es.jromero.ejbtest.EJBtest2Remote -- service jboss.naming.context.java.EJBtest1EAR.EJBtest2."EJBtest2!es.jromero.ejbtest.EJBtest2Remote"

                           

                          This is what my "server" exports:

                           

                            java:global/EJBtest1EAR/EJBtest2/EJBtest2!es.jromero.ejbtest.EJBtest2Remote

                            java:app/EJBtest2/EJBtest2!es.jromero.ejbtest.EJBtest2Remote

                            java:module/EJBtest2!es.jromero.ejbtest.EJBtest2Remote

                            java:jboss/exported/EJBtest1EAR/EJBtest2/EJBtest2!es.jromero.ejbtest.EJBtest2Remote

                            java:global/EJBtest1EAR/EJBtest2/EJBtest2

                            java:app/EJBtest2/EJBtest2

                            java:module/EJBtest2

                           

                          I've tried with all the previous names but the same error is launched.

                          Any ideas?

                           

                          Thanks