-
1. Re: WildFly 8: Remote EJB-lookup fails on first deploy
jaikiran May 23, 2014 12:10 AM (in response to boldt)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 resolved class, org/jboss/ejb/client/EJBClientContext, have different Class objects for the type oss/remoting3/Connection;)V used in the signature
at org.jboss.naming.remote.client.ejb.RemoteNamingStoreEJBClientHandler.associate(RemoteNamingStoreEJBClientHandler.java:78) [jboss-remote-naming-2.0.0.Final.jar:2.0.0.Final]
at org.jboss.naming.remote.protocol.v1.RemoteNamingStoreV1.<init>(RemoteNamingStoreV1.java:71) [jboss-remote-naming-2.0.0.Final.jar:2.0.0.Final]
at org.jboss.naming.remote.protocol.v1.VersionOne.getRemoteNamingStore(VersionOne.java:50) [jboss-remote-naming-2.0.0.Final.jar:2.0.0.Final]
at org.jboss.naming.remote.protocol.Versions.getRemoteNamingStore(Versions.java:55) [jboss-remote-naming-2.0.0.Final.jar:2.0.0.Final]
at org.jboss.naming.remote.client.RemoteContextFactory.createVersionedStore(RemoteContextFactory.java:73) [jboss-remote-naming-2.0.0.Final.jar:2.0.0.Final]
at org.jboss.naming.remote.client.HaRemoteNamingStore.failOverSequence(HaRemoteNamingStore.java:202) [jboss-remote-naming-2.0.0.Final.jar:2.0.0.Final]
at org.jboss.naming.remote.client.HaRemoteNamingStore.namingStore(HaRemoteNamingStore.java:149) [jboss-remote-naming-2.0.0.Final.jar:2.0.0.Final]
at org.jboss.naming.remote.client.HaRemoteNamingStore.namingOperation(HaRemoteNamingStore.java:130) [jboss-remote-naming-2.0.0.Final.jar:2.0.0.Final]
at org.jboss.naming.remote.client.HaRemoteNamingStore.lookup(HaRemoteNamingStore.java:272) [jboss-remote-naming-2.0.0.Final.jar:2.0.0.Final]
at org.jboss.naming.remote.client.RemoteContext.lookup(RemoteContext.java:79) [jboss-remote-naming-2.0.0.Final.jar:2.0.0.Final]
at org.jboss.naming.remote.client.RemoteContext.lookup(RemoteContext.java:83) [jboss-remote-naming-2.0.0.Final.jar:2.0.0.Final]
at javax.naming.InitialContext.lookup(InitialContext.java:411) [rt.jar:1.7.0_25]
at javax.naming.InitialContext.lookup(InitialContext.java:411) [rt.jar:1.7.0_25]
at de.dennis_boldt.HelloJndi.getHello(HelloJndi.java:28) [hello-commons-0.0.1-SNAPSHOT.jar:]
at de.dennis_boldt.HelloImpl.<init>(HelloImpl.java:18) [hello-commons-0.0.1-SNAPSHOT.jar:]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.7.0_25]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [rt.jar:1.7.0_25]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.7.0_25]
at java.lang.reflect.Constructor.newInstance(Constructor.java:526) [rt.jar:1.7.0_25]
at org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:110) [weld-core-impl-2.1.2.Final.jar:2014-01-09 09:23]
... 117 moreAre you packaging any JBoss specific jar files like the ones containing the org.jboss.ejb.client or org.jboss.remoting3 packages? If yes, remove them from your deployed application packaging.
-
2. Re: WildFly 8: Remote EJB-lookup fails on first deploy
boldt May 23, 2014 5:28 AM (in response to jaikiran)Refering to [1], I need to set this property:
jndiProps.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jboss.naming.remote.client.InitialContextFactory"
);
This class is shipped with the wildfly-ejb-client-bom. You can have a look into my packed wars here [2].
-
3. Re: WildFly 8: Remote EJB-lookup fails on first deploy
wdfink May 23, 2014 12:34 PM (in response to boldt)You should not set
jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");
this is for the ejb-client approach which is recommended by the way.
Also you should not pack any server side jar's into your war application (like xnio* jboss* jars).
With maven you need to check that all projects which set the dependency include scope=provided
-
4. Re: WildFly 8: Remote EJB-lookup fails on first deploy
boldt May 28, 2014 12:51 PM (in response to wdfink)I removed the property org.jboss.ejb.client.naming [1]. I siill have the same issue; the hello-project just works on the second deploy.
I also exchanged the wildfly-ejb-client-bom with the shipped jboss-client.jar [2]. For this, I ran th following within the
{WIDFLY}/bin/client/
directory:mvn install:install-file -Dfile=jboss-client.jar -DgroupId=de.dennis_boldt -DartifactId=jboss-client -Dversion=1.0.0 -Dpackaging=jar
Also the same issue; the hello-project just works on the second deploy. Btw: Is there any differece between the wildfly-ejb-client-bom and the shipped jboss-client.jar?
I also tried the approach with the property-files; I can't get this work at all.
Maybe someone can provide me a small fix (e.g., a github pull request?). Probably it is just a small fix, which cost me already plenty of time
[1] https://github.com/boldt/wildfly8-helloworld/commit/6c17a1dac60e3255a6965768705b70f5d6d8e462[2] https://github.com/boldt/wildfly8-helloworld/commits/jboss-client