-
1. Re: JNDI lookup in JBoss AS 7 in standalone clustered environment
jaikiran Feb 22, 2012 2:34 AM (in response to pavel.orehov)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.
-
2. Re: JNDI lookup in JBoss AS 7 in standalone clustered environment
pavel.orehov Feb 22, 2012 2:46 AM (in response to jaikiran)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.
-
3. Re: JNDI lookup in JBoss AS 7 in standalone clustered environment
jaikiran Feb 22, 2012 4:03 AM (in response to pavel.orehov)1 of 1 people found this helpfulThe 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
-
4. Re: JNDI lookup in JBoss AS 7 in standalone clustered environment
pavel.orehov Feb 22, 2012 5:39 AM (in response to jaikiran)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 ?