Pavel Orehov wrote:
The JNDI lookup:
Context context = new InitialContext();
CommEx commEx = (CommEx) context.lookup("global/myapp/myejbjar/CommExBean!com.test.CommEx");
Are you really using that exact JNDI name and not java:global/...? I wouldn't have expected the lookup to work with the explicit java:global namespace, even in the case of the bean being deployed on the same server instance.
We are in stage of setting that environment, as moving from JBoss 6.1, so not sure about the right way.
As I mentioned I tried with and without prefixes as well as with and without global.
1 of 1 people found this helpful
The EJB3.1 spec specifies the JNDI names to which the EJBs will be bound. java:global is one such namespace. Keeping aside the issue that you are running into while looking up EJBs across different server instances - your code should use the java:global JNDI namespace lookup if it's doing the looking in the same server instance.
If you want to lookup a EJB on a different server instance, then the proceedure is explained here https://docs.jboss.org/author/display/AS71/EJB+invocations+from+a+remote+server+instance
Sorry that I was not clear enought when I said "another server instance", what I actually meant that we have several server instances with different profiles, while EJB can reside in Profile A and Web EJB client in Profiler B, but all instances are running in the same cluster.
So, I would expect that JBoss will know to find EJB of Profile A among all instances in cluster without need to specify host&port in XMLs as you mentioned in the guide above.
Something that worked with HA JNDI in JBoss 6 with distributed JNDI tree. Is there something paraller in AS 7 ?