0 Replies Latest reply on Aug 16, 2015 10:30 AM by Sreenath Reddy

    java.lang.LinkageError: loader constraint violation while invoking the remote EJB

    Sreenath Reddy Novice

      I am invoking ejb by using the below code

       

      final Properties props = new Properties();

        props.put(Context.INITIAL_CONTEXT_FACTORY,

        "org.jboss.naming.remote.client.InitialContextFactory");

        props.put(Context.PROVIDER_URL, "http-remoting://127.0.0.1:8080");

        props.put(Context.SECURITY_PRINCIPAL, "ejb");

        props.put(Context.SECURITY_CREDENTIALS, "ejb");

        props.put("jboss.naming.client.ejb.context", Boolean.TRUE);

        props.put("org.jboss.ejb.client.scoped.context", "true");

        // props.put("mail.smtp.socketFactory.fallback", "true");

        final Context context;

        context = new InitialContext(props);

       

        name = "project-ear/project-ejb/AppProviderBean!com.project.action.AppProvider";

       

        AppProvider bean=(AppProvider)context.lookup(name);

        bean.dosomething()

       

      I am getting the below Exception

       

       

      19:35:50,282 INFO  [org.xnio] (MSC service thread 1-1) XNIO version 3.3.0.Final

      19:35:50,321 INFO  [org.xnio.nio] (MSC service thread 1-1) XNIO NIO Implementation Version 3.3.0.Final

      19:35:50,457 INFO  [org.jboss.remoting] (MSC service thread 1-1) JBoss Remoting version 4.0.6.Final

      19:35:54,772 INFO  [org.jboss.as.naming] (default task-6) JBAS011806: Channel end notification received, closing channel Channel ID 7058a078 (inbound) of Remoting connection 037522ed to /127.0.0.1:65407

      19:35:54,449 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./project: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./project: Failed to start service

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_11]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_11]

        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_11]

      Caused by: java.lang.RuntimeException: org.jboss.seam.InstantiationException: Could not instantiate Seam component: projectApplicationScopeData

        at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:222)

        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:87)

        at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start(UndertowDeploymentService.java:72)

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]

        ... 3 more

      Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: projectApplicationScopeData

        at org.jboss.seam.Component.newInstance(Component.java:2208)

        at org.jboss.seam.contexts.Contexts.startup(Contexts.java:343)

        at org.jboss.seam.contexts.Contexts.startup(Contexts.java:317)

        at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:143)

        at org.jboss.seam.init.Initialization.init(Initialization.java:813)

        at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:36)

        at com.project.session.ProjectSessionListener.contextInitialized(ProjectSessionListener.java:58)

        at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173)

        at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:193)

        ... 7 more

      Caused by: java.lang.RuntimeException: exception invoking: loadInitialEntities

        at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:154)

        at org.jboss.seam.Component.callComponentMethod(Component.java:2313)

        at org.jboss.seam.Component.callCreateMethod(Component.java:2236)

        at org.jboss.seam.Component.newInstance(Component.java:2196)

        ... 15 more

      Caused by: java.lang.reflect.InvocationTargetException

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_11]

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_11]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_11]

        at java.lang.reflect.Method.invoke(Method.java:483) [rt.jar:1.8.0_11]

        at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)

        at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)

        at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)

        at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)

        at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

        at org.jboss.seam.bpm.BusinessProcessInterceptor.aroundInvoke(BusinessProcessInterceptor.java:51)

        at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

        at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)

        at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)

        at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)

        at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:196)

        at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:114)

        at com.project.action.ProjectApplicationScopeData_$$_javassist_seam_2.loadInitialEntities(ProjectApplicationScopeData_$$_javassist_seam_2.java)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_11]

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_11]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_11]

        at java.lang.reflect.Method.invoke(Method.java:483) [rt.jar:1.8.0_11]

        at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)

        at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)

        ... 18 more

      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

        at org.jboss.naming.remote.client.ejb.RemoteNamingStoreEJBClientHandler.associate(RemoteNamingStoreEJBClientHandler.java:78)

        at org.jboss.naming.remote.protocol.v1.RemoteNamingStoreV1.<init>(RemoteNamingStoreV1.java:71)

        at org.jboss.naming.remote.protocol.v1.VersionOne.getRemoteNamingStore(VersionOne.java:50)

        at org.jboss.naming.remote.protocol.Versions.getRemoteNamingStore(Versions.java:55)

        at org.jboss.naming.remote.client.RemoteContextFactory.createVersionedStore(RemoteContextFactory.java:73)

        at org.jboss.naming.remote.client.HaRemoteNamingStore.failOverSequence(HaRemoteNamingStore.java:202)

        at org.jboss.naming.remote.client.HaRemoteNamingStore.namingStore(HaRemoteNamingStore.java:149)

        at org.jboss.naming.remote.client.HaRemoteNamingStore.namingOperation(HaRemoteNamingStore.java:130)

        at org.jboss.naming.remote.client.HaRemoteNamingStore.lookup(HaRemoteNamingStore.java:272)

        at org.jboss.naming.remote.client.RemoteContext.lookup(RemoteContext.java:79)

        at org.jboss.naming.remote.client.RemoteContext.lookup(RemoteContext.java:83)

        at javax.naming.InitialContext.lookup(InitialContext.java:417) [rt.jar:1.8.0_11]

        at javax.naming.InitialContext.lookup(InitialContext.java:417) [rt.jar:1.8.0_11]

        at com.project.LocalEJBLookup.lookup(LocalEJBLookup.java:194)

        at com.project.LocalEJBLookup.lookup(LocalEJBLookup.java:73)

        at com.project.LocalEJBLookup.getAppProvider(LocalEJBLookup.java:334)

        at com.project.action.ProjectAppData.loadLanguages(ProjectAppData.java:728)

        at com.project.action.ProjectAppData.loadInitialEntities(ProjectAppData.java:165)

        at com.project.action.ProjectApplicationScopeData.loadInitialEntities(ProjectApplicationScopeData.java:50)

        ... 41 more