[jboss-user] [JNDI and Naming] - [AS7.1.1] EJB JNDI Lookup confusion: remote vs local

Philipp Nanz do-not-reply at jboss.com
Tue Nov 6 10:39:05 EST 2012


Philipp Nanz [https://community.jboss.org/people/philippn] created the discussion

"[AS7.1.1] EJB JNDI Lookup confusion: remote vs local"

To view the discussion, visit: https://community.jboss.org/message/775116#775116

--------------------------------------------------------------
Hi all,

I have read the docs regarding remote JNDI lookup, but somehow it doesn't seem to match my first-hand experiences. I hope someone can clear this up for me.

My application basically looks like this:

Business.ear
-- service.jar (EJB JAR)
-- web.war

Additionally, there is an remote client talking the app using EJB remoting...


1) Local JNDI lookup (used inside the JAR and partially in the WAR):

JNDI name: java:global/Business/service/FooEJB!foo.bar.ServiceLocal

This works nicely, always.

2) Remote JNDI lookup, from within the WAR:


+InitialContext is basically empty in this scenario.+


JNDI name: ejb:Business/service/FooEJB!foo.bar.Service

This works as well, but there are two strange(?) differences compared to the local lookup:
The prefix must be 'ejb:', 'java:' doesn't work. Also it doesn't work with 'global/' (or any other scope). Ok, I admit, this may be a remote thing, but still I'm wondering...

3) Remote JNDI lookup, from external application:

+InitialContext:+

java.naming.factory.initial=org.jboss.naming.remote.client.InitialContextFactory
java.naming.provider.url=remote://somehost:4447
jboss.naming.client.ejb.context=true

JNDI name: java:Business/service/FooEJB!foo.bar.Service

Now it's getting crazy. This works as well, but as you see I need to use 'java:' prefix. With 'ejb:' prefix I get the dreaded NameNotFoundException  :( 


Can anyone make any sense of this?!

Thanks in advance!
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/775116#775116]

Start a new discussion in JNDI and Naming at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2083]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20121106/207dd77b/attachment.html 


More information about the jboss-user mailing list