my project contains of three (eclipse) project. One project contains all JPA files, the second contains the Stateless Session Beans (with all CRUD operations) and the least project contains the web (Struts 2) application. How can I combine the Actions with the beans without a lot of additional code (InitialContext etc.). Is there a way to get a reference via reference injection or what is the normal approach for this task?
In theory, you're supposed to be able to use the @EJB annotation in a web client. In practice, most web containers don't support it. The best way I know of to get an EJB3 reference that works fairly consistently is: