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

admin 12

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

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



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 thoughts on “Deployment under JBoss-4.0.0 with Eclipse's JBoss-IDE plugin

  1. Warning, everyone. These instructions do not work for Eclipse 3.2 and JBoss-IDE 1.6.0. They are not compatible and one of the features that fails is the packager. I have wasted several hours on this, and wanted to save others the grief. I guess you can try the alpha release of JBoss-IDE 2.0, or just use an ant script for packaging.

    Thanks for the very clear instructions, though!

  2. Hi,

    I have eclipse 3.1 with Flex plug in and Tomcat Server.Do anyone know how to deploy the mxml files on a Tomcat server.I read somethink about it and all I understood was that I have to deploy the projects as war files. I tried but my projects did not work.Acctualy I do not know if I made the war files corectly.So my question is: Is it ZIP file and WAR file same thing with different extention?

    Thank you,

  3. Hi,

    Can you please send me he steps to deploy web application which is devloped using struts+jboss+mysql. It would be great if you can send me the detailed steps for the deployment + package hierarchy

  4. Hi folks, i just wants to say that i would apreciate if some one can get us some informations or a kind of howto (remote deployment ) thanks in advence!

  5. It will helpful for ant Script users.
    I need help regarding making WAR files with JBoss-IDE

  6. Ad 1. Of course, when your packaging is taken care of by an Ant script, you don’t need the packaging facilities offered by the JBoss plug-in. As a matter of fact, I prefer using Maven myself now instead (I used it at that time because I did not find/make the time to implement an Ant script).

    Ad 2. I don’t have any experiences with remote JBoss deployment (yet), can anyone else comment on this?

  7. 1> I have an ant file to create jar, war and ear file. Do I still need to run packaging?
    2> How do I deploy on a remote server?

  8. I did use the “default” server flavor though! It seems like something else is the cause of your problems. Maybe you’re making use of a service not present/activated in the default configuration of JBoss??

  9. It seams that you can’t use the “default” server flavor, as you get errors from missing AOP libraries when deploying servlets. Use “standard” or “all” instead.

  10. You are completey right! I now see that I never really cleaned my struts-config.xml from elements I don’t use. Somehow it never bothered before… Thanks!

Comments are closed.

Next Post

Oracle Designer - on Design Editor performance and Repository Maintenance

Yesterday it was an almost nostalgic day. For several years – primarily in the late 1990’s – I was heavily engaged in everything to do with Oracle Designer, its Repository and API, and Version Control of Configuration Management. I spent many weeks at the UK Development Center for Designer 6i, […]
%d bloggers like this: