Is Spring compatible with EJB / remote naming?
pbenedict Apr 24, 2014 11:51 AMI have a Spring 3.2 webapp deployed on server A and remote EJBs deployed on server B. Both servers are using WildFly 8. The webapp is unable to see the remote EJBs.
Here is the Spring config:
<util:properties id="props" location="classpath:/jndi.properties"/> <jee:remote-slsb id="locationService" jndi-name="myapp/myejb/LocationServiceBean!com.company.LocationService" resource-ref="false" environment-ref="props" business-interface="com.company.LocationService"/>
Here are the properties:
java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory java.naming.provider.url=http-remoting://localhost:8080 java.naming.security.principal=ejb java.naming.security.credentials=test
And I am importing the correct module (necessary to make visible the JBoss InitialContextFactory referenced above):
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0"> <deployment> <dependencies> <module name="org.jboss.remote-naming" /> </dependencies> </deployment> </jboss-deployment-structure>
Upon startup of the webapp, the home interface can be found. However, invocation always always always fails. I have yet to ever get it to work.
Caused by: java.lang.IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling [appName:myapp, moduleName:myejb, distinctName:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext@7261573e at org.jboss.ejb.client.EJBClientContext.requireEJBReceiver(EJBClientContext.java:749) at org.jboss.ejb.client.ReceiverInterceptor.handleInvocation(ReceiverInterceptor.java:116) at org.jboss.ejb.client.EJBClientInvocationContext.sendRequest(EJBClientInvocationContext.java:186) at org.jboss.ejb.client.EJBInvocationHandler.sendRequestWithPossibleRetries(EJBInvocationHandler.java:253) at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:198) at org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:181) at org.jboss.ejb.client.EJBInvocationHandler.invoke(EJBInvocationHandler.java:144) at com.sun.proxy.$Proxy113.locate(Unknown Source)
FYI, I followed the instructions here: