EJB invocations from a remote server instance
c.keimel Jun 23, 2014 11:08 AMHello
I am testing remote invocations from one server to another. I tried the configuration following this article:
https://docs.jboss.org/author/display/WFLY8/EJB+invocations+from+a+remote+server+instance
For test purposes I have two wildfly instances running localy. I deployed a simple test bean (RemoteTest) on the destination server (localhost:9080). The RemoteTest bean is deployed ok, since I can reach it from a client application. I am trying to call this bean from another bean (TestBean) on the client server (localhost:8080). I modified the standalone.xml of the client server:
<security-realms>
...
<security-realm name="remote-ejb-security-realm">
<server-identities>
<secret value="YWRtaW4x"/>
</server-identities>
</security-realm>
</security-realms>
...
<subsystem xmlns="urn:jboss:domain:remoting:2.0">
<endpoint worker="default"/>
<http-connector name="http-remoting-connector" connector-ref="default" security-realm="EJBRealm"/>
<outbound-connections>
<remote-outbound-connection name="remote-ejb-connection" outbound-socket-binding-ref="remote-ejb" protocol="http-remoting" security-realm="remote-ejb-security-realm" username="admin">
<properties>
<property name="SASL_POLICY_NOANONYMOUS" value="false"/>
<property name="SSL_ENABLED" value="false"/>
</properties>
</remote-outbound-connection>
</outbound-connections>
</subsystem>
...
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
...
<outbound-socket-binding name="remote-ejb">
<remote-destination host="localhost" port="9080"/>
</outbound-socket-binding>
</socket-binding-group>
When I try to establish the connection with this code
props.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming");final Hashtable<String, String> props = new Hashtable<String, String>();
final Context context = new InitialContext(props);
RemoteTest service = (RemoteTest) context.lookup("ejb:GosaEjb3TestRemoteEAR/de.emsw.gosa.ejb3.test.remote.server/RemoteTestBean!de.emsw.gosa.ejb3.test.remote.RemoteTestRemote");
logger.info(service.helloWorld());
I receive this exception:
Caused by: java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:GosaEjb3TestRemoteEAR, moduleName:de.emsw.gosa.ejb3.test.remote.server, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@9dc933
at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:749) [jboss-ejb-client-2.0.0.Final.jar:2.0.0.Final]
at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:116) [jboss-ejb-client-2.0.0.Final.jar:2.0.0.Final]
...
Thanks for any pointers of what I could try, to get this working.
Regards
Christoph