Running Your First EJB Application

Several example programs are included with the JOnAS distribution. They are located in the $JONAS_ROOT/examples/src directory. The one we will use as your first EJB application is the Session Bean (SB) example that resides in $JONAS_ROOT/examples/src/sb.

The SB example involves a Java client that accesses a Stateful Session Bean and twice invokes the buy method of the bean transaction. The client communicates with JOnAS using RMI and the configuration files should be already set so that the RMI registry will be automatically started and embedded in the same JVM as JOnAS. The figure below gives an overview of this application.

Figure 1: EB example overview