Tuesday 24 November 2015

Configuring an EJB environment

This is a specific post to describe the steps to configure an environment in your IDE to create EJB applications, and deploy them successfully in a server.

In the example are used:
  • IDE - Eclipse Luna
  • Server - glassfish 3.1
  • JDK - Java 1.7

Create EJB project

EJB project structure - example

*Note: Take into account that the EJB 3.1 API needs to be added to the build path



The implementations details are in the previous post: http://javawithbreakfast.blogspot.com/2015/11/ocejbcd-3-accesing-session-beans.html

Create Web project



Web project structure:

*Note: Take into account that the servlet3.0 API needs to be added to the build path

Make the EJB project visible to the web project

Include the EJB project in the build path of the web project:
-Select web project, right button.
-Build path/Projects/ Add the EJB project




Important: to make the EJBs visible to the web project, the EJB project should be included in the deployment assembly:
- Select web project, right button. 
- Deployment assembly/ Add:  add EJB jar



Deployment
Deploy both projects in the server:


No comments:

Post a Comment