This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Confused of Local Interface and Remote Interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Confused of Local Interface and Remote Interface" Watch "Confused of Local Interface and Remote Interface" New topic
Author

Confused of Local Interface and Remote Interface

Stephen Lee
Ranch Hand

Joined: Dec 11, 2001
Posts: 74
I am very new to EJB. After reading some materials and trying some samples, I understand the concept of Local Interface and Remote Interface. However, I am still confused of difference between Remote Interface and Local Interface. When should I use them?
I am now creating a servlet which calls a session bean while this session bean will call the entity bean for the data. The session bean is Remote Interface while I want to call the entity bean of Local Interface (I am trying to follow an example in the book of Mastering of EJB). However, it fails to call the entity bean. It says something of naming exception. When I call the entity bean with Remote Interface, it is successful. Why does this happen?
Stephen
SAFROLE YUTANI
Ranch Hand

Joined: Jul 06, 2001
Posts: 257
Are you sure you defined a JNDI name for the local interface? You need 1 JNDI name for the remote interface, and 1 JNDI name for the local interface. Both are usually specified in a vendor-specific deployment descriptor. For the case of Weblogic, this file is weblogic-jar.xml.
SAF
Karl Laird
Ranch Hand

Joined: Jul 14, 2001
Posts: 67
Are they both deployed in the same naming context and container? To use the local interface beans must be colocated within the same EAR, and use the same naming context in the .xml descriptor


The Eagle sneers at the Peacock<p>Systems Administrator<br />OrderWare Solutions Ltd<br /><a href="http://www.orderware.net" target="_blank" rel="nofollow">http://www.orderware.net</a>
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Confused of Local Interface and Remote Interface
 
Similar Threads
EJB 3.0 JPA client jar
Local interface and local home interface
Local Vs Remote
findByPrimaryKey not being called
Remote or local call