[jboss-user] [JNDI and Naming] - regarding ejb remote access with global JNDI Namespace
Dominique Jean-Prost
do-not-reply at jboss.com
Tue Jul 19 12:51:34 EDT 2011
Dominique Jean-Prost [http://community.jboss.org/people/djeanprost] created the discussion
"regarding ejb remote access with global JNDI Namespace"
To view the discussion, visit: http://community.jboss.org/message/616187#616187
--------------------------------------------------------------
Hello everybody,
After searching for an error during half a day, I found a very strange behaviour in jboss 5.1.0GA that I can't explain. Here is my case :
My jboss server holds an EJB 2.1 bound to this jndi name : +"A"+. Please note that it is bound to a global jndi namespace (not a +java:+ namespace). As is, it is considered as remote.
I wrote a unit test where I :
- lookup this EJB using +java:/A+ <-- my error I searched for a long time
- call a method on the stub
--> It works, even though I made a mistake on the jndi name.
Then I deployed a second ejb on another jboss server, which looked up the A ejb on the other server using the same "wrong" name +"java:/A"+ : I got the *NameNotBoundException* which is normal.
After searching half a day the reason why I got the *NameNotBoundException,* I realized that my mistake was the jndi name I kept on using : +java:/A+
So I changed it to "A", and then my lookup started to work.
I now have found my error and am happy with it. The only thing I don't understand is that my code in my unit test still works using +java:/A+ which is false.
Is there somewhere in jboss some code that would say. "ok, even if the name my client is requesting is +java:/foo+, I try to search +foo+ just in case my client would have made a mistake, because I do know that I'm called by a remote client". This behaviour would not occur when called within a jboss server, even if used as a remote client for another server ?
Can someone explain it to me ?
Thank you.
Dom
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/616187#616187]
Start a new discussion in JNDI and Naming at Community
[http://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/20110719/5a6a975f/attachment-0001.html
More information about the jboss-user
mailing list