Remote EJB not working from WAR to EAR
davidj Jul 5, 2012 12:50 PMHi,
I've got two JBoss AS 7.1.1Final servers.
One has a WAR file.
The second has an EAR file.
My goal is to have the WAR file use remote EJBs in the EAR file. Setup is as follows.
I have a JAR file containing the @Remote interfaces. It is called "remote.jar".
! have a JAR file containing the @Entity JPA entity class. It is called "model.jar".
The WAR file contains both remote.jar and model.jar.
The EAR file also contains both remote.jar and model.jar. The EAR file also contains another JAR file called "domain.jar" which contains the @Stateless EJBs which implement the @Remote interfaces. My "persistence.xml" is also contained within "domain.jar".
If I deploy both the WAR file and EAR file to the same machine, everything works. It I deploy the EAR file to another machine, then it doesn't work.
I have tried two different methods: 1) Remote-JNDI lookup, and 2) JBoss EJB-remote client lookup.
I've taken instruction from the following JBoss websites:
https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+server+instance
https://community.jboss.org/thread/19710
I've followed these instructions as closely and exactly as possible. I've even stripped-down my JAR files to be as simple as possible (one Entity, one Remote, one EJB, etc.).
As a side note; my setup works with Glassfish 3.1.2 (minus all of the JBoss configuration stuff, of course, such as jboss-ejb-client.properties, and JBoss JNDI stuff, etc.).
Also as a side note: The instructions given in the second URL link above (EJB+invocations+from+a+remote+server+instance) I really, really hope is not truly what JBoss developed for EJBs. These instructions seem like a hack (no offense); having to edit all those xml files etc. Plus, it doesn't allow for easily swapping if you have multiple remote EJBs running on different boxes.
Any advice would be appreciated.
Thanks.
PS The error message I get depends upon which method I'm attempting. If I'm using the Remote JNDI lookup method, I get a message javax.naming.NameNotFoundException. If I use the JBoss EJB-remote client method I get: "No EJB receiver available for handling [appName:" message.
I'm using the latest and greatest versions of Java EE 6. Including: JSF 2.x, JPA 2, EJB 3.x