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).
This is what I have done in eclipse...
AppEJB - is a EJB project that contains all the ejb code.
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.
AppWeb - is the Dynamic Web Application project containing the JSF front end.
AppEAR - this contains AppEJB.
Following is the ejb in AppEJB
@Stateless(name="UserManager")
@LocalBean
public class UserManagerImpl implements UserManager {
public void createUser(User user) {
}
}
Following is the remote interface in AppEJBInterfaces
@Remote
public interface UserManager {
public void createUser(User user);
}
This is what I do in the JSF managed bean
@ManagedBean
@SessionScoped
public class UserLoginManager implements Serializable{
@EJB(mappedName="UserManager")
UserManager userManager;
}
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
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?