aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Calling local Session beans without JNDI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Calling local Session beans without JNDI" Watch "Calling local Session beans without JNDI" New topic
Author

Calling local Session beans without JNDI

Rahul Juneja
Ranch Hand

Joined: Aug 03, 2002
Posts: 425
Hi Guys !

I was jus wondering if I can call Local Entity/Session bean from another session bean without doing the lookup as they are on the same JVM.

Cheers,
Rahul
[ June 27, 2005: Message edited by: Rahul Juneja ]

Rahul Juneja
ThoughtClicks - http://techlabs.thoughtclicks.com
Annie Smith
Ranch Hand

Joined: Mar 05, 2005
Posts: 172
Although it intuitively seems that an enterprise bean should know another one residing on the same server, it doesn't really hold true. An enterprise bean or for that matter, any server object, is not suppose to know the storage structure/mechanism. That's where JNDI comes in the picture. Even for local objects, there has to be a lookup mechanism as for any server object. So, you couldn't just get away from JNDI.


Cheers!<br /><b>Annie</b>
Rahul Juneja
Ranch Hand

Joined: Aug 03, 2002
Posts: 425
Annie,

I am not sure about this. Have u tried that, I mean have u experienced that in past.

Cheers,
Rahul
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30752
    
156

Rahul,
If you try to access the EJB without using the JNDI, you won't get the services provided by the container. You can call it as regular code, but that misses the point of EJBs.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Calling local Session beans without JNDI