Running An EJB Example

Enterprise JavaBean has a minimum of three classes, the remote interface, the home interface, and the bean implementation. The remote interface is the class that exposes the methods of the EJB to the outside world. The home interface specifies how to create a bean that implements the remote interface. The bean implementation provides an implementation of the methods specified by the remote and home interfaces. The classes must be packaged into a JAR archive with a directory structure that reflects the hierarchy of packages.

The deployment descriptor file tells the EJB server which classes make up the bean implementation, the home interface and the remote interface. If there is more than one EJB in the package, it indicates also how the EJBs interact with one another. In this simple example, there is only one EJB so we won't need to worry about that part. The deployment descriptor must be called ejb-jar.xml

Step 1: Running of Application Server

Step 2: Setting of  all the Environment variables

Step 3: To build the EJB jar

Step 4:  Deploy the Bean

Step 5: Coding and compiling the test client