iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
An EJB local interface exposes a session bean’s business methods to clients in the same Java virtual machine (JVM). In EJB 3.0 and later, this usually means a local business interface: an ordinary Java interface, not one that must extend EJBLocalObject. Older EJB code uses “local interface” for a different, legacy component interface.
What “EJB local interface” means
In modern Enterprise Beans terminology, a local business interface is the contract through which a local client calls a session bean’s business methods. The client must be collocated with the bean in the same JVM; “local” does not simply mean on the same network or hosted by the same application server. The Jakarta Enterprise Beans 4.0 specification states that access through the local client view requires both the client and bean to be collocated in the same JVM.
Modern and legacy local interfaces are different
EJB 3.0 and later: local business interface
A modern local business interface is an ordinary Java interface. It declares the business methods clients can call, and it does not need to extend EJBLocalObject. This is the form most developers mean when discussing a session bean’s local view.
EJB 2.1 and earlier: local component interface
Older EJB code may use “local interface” to mean a local component interface that extends EJBLocalObject and is paired with a local home interface. This is a separate, legacy client view that the specification retains for compatibility. The EJBLocalObject API documentation explains the distinction: EJB 3.0 and later do not require a local business interface to extend it.
#1 Best Overall
How to declare a local business interface
The jakarta.ejb.Local annotation marks a business interface as local. It can annotate the interface itself or the bean class. For example:
import jakarta.ejb.Local;
@Local
public interface OrderService {
Order findOrder(long id);
}
A bean class can also designate its local interface:
Rank #2
import jakarta.ejb.Local;
import jakarta.ejb.Stateless;
@Stateless
@Local(OrderService.class)
public class OrderServiceBean implements OrderService {
public Order findOrder(long id) {
// Business logic
return null;
}
}
When neither the interface nor bean class specifies @Local or @Remote, a business interface can be local by default under the conditions described in the Jakarta EE tutorial. The Jakarta EE @Local API documentation identifies situations where an explicit annotation is needed, including ambiguous cases involving multiple interfaces or a no-interface view.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minuteHow a local client accesses the bean
A local client can obtain a bean through dependency injection or a JNDI lookup, as described in the Jakarta EE tutorial. A session bean can also expose a no-interface view. That is a local view, but it is not a local business interface: it exposes eligible public methods of the bean implementation class instead.
Rank #3
What local access changes for callers
| Aspect | Local view | Remote view |
|---|---|---|
| Client location | Client and bean must be in the same JVM. | Location-independent client access. |
| Arguments and results | Passed by reference; caller and bean may observe shared object state. | Passed by value. |
| Cross-application portability | Required portable support is for local clients packaged in the same application as the bean. Access from another application is optional and vendor-specific. | Designed for clients that are not collocated with the bean. |
These semantics matter when passing mutable objects: a local caller and bean may work with the same object reference rather than independent copies. The specification describes the local and remote client views and their data-passing behavior.
Quick Recap
Best Value
Quick answers to common questions
- Does an EJB local interface extend
EJBLocalObject? Only the legacy local component interface does. A modern EJB 3.0+ local business interface does not have to. - Does local mean the same server? No. The requirement is same-JVM collocation.
- Is a no-interface view a local interface? It is a local client view, but it exposes eligible methods on the bean class rather than using a separate business interface.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

