title: How do I call a remote EJB in an EAR from another?
body: <p>In Weblogic 10.3, how do I inject a remote EJB from one EAR into a Stateless bean of another, both EARs being deployed in the same container? Ideally I'd like to do as much as possible with annotations.</p>
  
  <p>So suppose I have the following interface:</p>
  
  <pre><code>public interface HelloService {
    public String hello();
  }
  </code></pre>
  
  <p>implemented by the following EJB:</p>
  
  <pre><code>@Stateless
  @Remote
  public class HelloServiceBean implements HelloService {
    public String hello() {
        return "hello";
    }
  }
  </code></pre>
  
  <p>Suppose they're packaged and deployed in <code>server.ear</code>. Now in <code>client.ear</code>, I have the following:</p>
  
  <pre><code>@Stateless
  public class HelloClientBean {
      @EJB
      HelloService helloService;
  
  // other methods...
  }
  </code></pre>
  
  <p>What do I need to add so that Weblogic figures out the wiring correctly between <code>HelloClientBean</code> in <code>client.ear</code> and <code>HelloServiceBean</code> in <code>server.ear</code>? Pointers to official documentations and/or books warmly welcome.</p>