Deploying An EJB JAR file

In a conventional JBoss server, deploying any packages is simple: the archive file to deploy should be copied to the relevant server folder in JBoss. For example, simply copy an archive file to the C:\jboss4\server\default\deploy folder to deploy the module. If JBoss is running it detects the change and dynamically deploys the contents.

When programming using JBoss IDE, there is another way to deploy packages.

  1. In the Project Explorer View right click the calculator.jar file and select Run As > Run on Server context menu:

    Run As > Run on Server

  2. Select the JBoss 4 EJB 3.0 Server server and click the Next button.

    JBoss 4 EJB 3.0 Server

  3. Make sure the calculator.jar is in the Configured projects pane.

    Click the Finish button.

    Configured projects

  4. In the Console View, you should see some deployment activity. The Session EJB is now deployed:

    13:34:47,242 INFO  [Ejb3Deployment] EJB3 deployment time took: 297
    13:34:47,461 INFO  [JmxKernelAbstraction] installing MBean: jboss.j2ee:jar=calculator.jar,name=StatelessCalculatorBean,service=EJB3 with dependencies:
    13:34:47,757 INFO  [EJBContainer] STARTED EJB: by.iba.ejb.StatelessCalculatorBean ejbName: StatelessCalculatorBean
    13:34:47,851 INFO  [EJB3Deployer] Deployed: file:/C:/jboss4/server/default/deploy/calculator.jar
    								

  5. Verify the Remote Bean interface is available now via JNDI.

    Open JMX Console in your browser and select the service=JNDIView link:

    service=JNDIView

  6. Invoke the java.lang.String list() method to output JNDI info as text by clicking HTML form button:

    Output JNDI info as text

  7. You can see in the global JNDI namespace the Remote Interface (StatelessCalculator) is available at the global JNDI name StatelessCalculatorBean/remote.

    Global JNDI name: StatelessCalculatorBean/remote

Professional hosting     Belorussian informational portal         Free SCWCD 1.4 Study Guide     Free SCDJWS 1.4 Study Guide     SCDJWS 1.4 Quiz     Free IBM Certified Associate Developer Study Guide     IBM Test 000-287. Enterprise Application Development with IBM WebSphere Studio, V5.0 Study Guide     Free Mock Exam Engine