The EJB project needs to be packaged in a JAR file. We will be re-using the packaging configuration which was created in Part 1: Packaging A Stateless EJB.
Right-click on the Calculator project and select Run Packaging. The packaging will display its output in the console. The output should look like this:
Buildfile: C:\ejb3workspace\Calculator\packaging-build.xml N65540: _packaging_generation_: BUILD SUCCESSFUL Total time: 906 milliseconds
After the execution, you should have a project that looks like this:
OPTIONALLY: Undeploy the previous calculator.jar EJB module as described here: Undeploying An EJB JAR file.
In the Project Explorer View right click the calculator.jar file and select Run As > Run on Server context menu.
In the Console View, you should see some deployment activity. The Session EJBs are now deployed:
16:00:32,527 INFO [Ejb3Deployment] EJB3 deployment time took: 47 16:00:32,558 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:jar=calculator.jar,name=StatefulCalculatorBean,service=EJB3 with dependencies: 16:00:32,558 INFO [JmxKernelAbstraction] jboss.j2ee:jar=calculator.jar,name=StatelessCalculatorBean,service=EJB3 16:00:32,558 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:jar=calculator.jar,name=StatelessCalculatorBean,service=EJB3 with dependencies: 16:00:32,574 INFO [EJBContainer] STARTED EJB: by.iba.ejb.StatelessCalculatorBean ejbName: StatelessCalculatorBean 16:00:32,652 INFO [EJBContainer] STARTED EJB: by.iba.ejb.StatefulCalculatorBean ejbName: StatefulCalculatorBean 16:00:32,699 INFO [SimpleStatefulCache] Initializing SimpleStatefulCache with maxSize: 100000 timeout: 300 for jboss.j2ee:jar=calculator.jar,name=StatefulCalculatorBean,service=EJB3 16:00:32,699 INFO [EJB3Deployer] Deployed: file:/C:/jboss4/server/default/deploy/calculator.jar
OPTIONALLY: Verify the Stateful Bean Remote [Business] Interface is available now via JNDI.
Open JMX Console in your browser and select the service=JNDIView link.
Invoke the java.lang.String list() method to output JNDI info as text.
![]() ![]() ![]() ![]() ![]() ![]() |
![]() |
![]() |