Deployment under JBoss-4.0.0 with Eclipse's JBoss-IDE plugin html

Deployment under JBoss-4.0.0 with Eclipse's JBoss-IDE plugin

This evening I successfully re-deployed my application to JBoss-4.0.0. It used to be deployed under JBoss 3.2.4 using the Lomboz plug-in. Although the JBoss-IDE plug-in involves a bit more labour as compared to the Lomboz plug-in, the former requires a better understanding of the deployment process, which is always good to have!

So what are the required steps?

  1. Build a WAR file.
  2. Build an EJB jar file.
  3. Pack the archives in an EAR file, together with a MANIFEST.MF and packaging.xml.
  4. Deploy your application!

A more detailed recipe is listed below.

The packaging configuration tool of the JBoss-IDE plug-in for Eclipse is invoked by right-clicking on the project and selecting “properties” from the pop-up menu. Now choose “Packaging configurations”.

Ad 1.

Create a new WAR archive by right-clicking once more in the right most pane and selecting “Add Std. Archive” from the pop-up menu. Choose “Standard-WAR.war” and add your files to the WAR archive. In my case, working with Struts, I had to import the WEB-INF/classes, WEB-INF/lib, WEB-INF/struts-config.xml, WEB-INF/struts-html.tld, WEB-INF/struts-logic.tld, WEB-INF/struts-bean.tld, WEB-INF/web.xml, the index.jsp and the other JSP pages of course.

Remarkably, the container asked me to include tiles-defs.xml as well, although I don’t use it. After including it seemed to be satisfied though 😉

Ad 2.

Create a new EJB JAR archive by right-clicking in the right most pane and selecting “Add Std. Archive” from the pop-up menu. Choose “Standard-EJB.jar” and add your files to the EJB JAR archive. In my case, the EJB related binaries are compiled in the project’s /bin directory. You also need to include META-INF/jboss.xml, META-INF/jbosscmp-jcbc.xml and META-INF/ejb.xml. The latter three files need to go to the META-INF subdirectory in the JAR archive.

Ad 3.

Create a new EAR JAR archive by right-clicking in the right most pane and selecting “Add Std. Archive” from the pop-up menu. Choose “Standard-EAR.jar” and add your files to the EAR JAR archive. Now by right-clicking on the EAR archive, you can add your EJB JAR and WAR archive by importing them as files. This took me some time to figure out. Moreover, you have to add a MANIFEST.MF and application.xml. My MANIFEST.MF reads

Manifest-Version: 1.0
Created-By: 1.4.0-rc (Sun Microsystems Inc.)
Class-Path: Standard-EJB.jar

My application.xml reads

<application>
     <display-name>BibTeXML demo<display-name>

      <module>
         <web>
            <web-uri>Standard-WAR.war<web-uri>
            <context-root>bibtexml<context-root>
         <web>
      <module>

      <module>
         <ejb>Standard-EJB.jar<ejb>
      <module>
<application>

Ad 4.

Go back to your project explorer, right-click one more on the project and choose “run packaging” from the popup-menu. You’ll notice that a file called packaging-build.xml is added to your project, as well as the WAR and EAR archives.

Start your JBoss-4.0.0 application server in case you didn’t do it already.

Now you can right-click on the EAR and choose “deploy to”. A pop-up menu will ask you were to deploy it to. Choose the “default” configuration and your application will be deployed, and if all went well, will be deployed successfully 🙂

12 Comments

  1. Julie October 4, 2006
  2. Viktor July 13, 2006
  3. abdul April 29, 2006
  4. ELassad May 27, 2005
  5. Rafiuddin April 16, 2005
  6. Zeger Hendrikse April 6, 2005
  7. PK April 6, 2005
  8. janaka February 9, 2005
  9. Zeger Hendrikse November 8, 2004
  10. Uno Engborg November 7, 2004
  11. Zeger Hendrikse October 22, 2004
  12. Leon van Tegelen October 22, 2004