title: TomEE on eclipse, How to call a remote EJB from a JSF Managed bean?
body: <p>I want to have JSF 2.0 page in one instance of TomEE server calling a Remote EJB running under a different TomEE server, (both obviously running on different ports).
  <br><br>
  This is what I have done in eclipse... <br></p>
  
  <p>AppEJB - is a EJB project that contains all the ejb code.<br>
  AppEJBInterfaces - This project contains all the remote interfaces, the idea is that this jar will be added to the class path of the web application project containing JSF front end.<br>
  AppWeb - is the Dynamic Web Application project containing the JSF front end. <br>
  AppEAR - this contains AppEJB.</p>
  
  <p>Following is the ejb in AppEJB <br></p>
  
  <pre><code>@Stateless(name="UserManager")
  @LocalBean
  public class UserManagerImpl implements UserManager {
      public void createUser(User user) {
      }
  }   
  </code></pre>
  
  <p>Following is the remote interface in AppEJBInterfaces <br></p>
  
  <pre><code>@Remote
  public interface UserManager {
  public void createUser(User user);
  }
  </code></pre>
  
  <p>This is what I do in the JSF managed bean <br></p>
  
  <pre><code>@ManagedBean
  @SessionScoped
  public class UserLoginManager implements Serializable{  
  @EJB(mappedName="UserManager")
  UserManager userManager;
  }
  </code></pre>
  
  <p>I have created a server in eclipse and pointed it to the TomEE 1.6 plus installation. I have added the WebApp to the server. When I right click on the server I don't see the option to add the AppEAR project, so the questions I have are <br></p>
  
  <p>How do I add/deploy the EJB project or the AppEAR to the server (TomEE in eclipse)?
  How do I get the JSF managed bean to lookup the remote EJB?
  If we assume that I convert the ejbs to local beans How do I specify the jndi names/config?</p>