Can using @EJB work even if the EJB interface is not denoted with @Remote or @Local annotation?
Issue
- The following EJB declaration :
@Stateless
public class StandardHelloImpl implements HelloService {
@Override
public String getHelloMessage() {
return "Hello New Customer";
}
}
The interface is:
public interface HelloService {
String getHelloMessage();
}
does not have @Remote or @Local marked on the interface. Can this setup work when using @EJB to setup a reference when calling EJB's?
Environment
- Yes. This will work. Since in the above example,"HelloService" is the only implemented interface of the EJB, the container assumes that it must be a local business interface.
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.