Can using @EJB work even if the EJB interface is not denoted with @Remote or @Local annotation?

Solution In Progress - Updated -

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 of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.