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?
- Build a WAR file.
- Build an EJB jar file.
- Pack the archives in an EAR file, together with a
- 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”.
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
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 😉
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/ejb.xml. The latter three files need to go to the
META-INF subdirectory in the JAR archive.
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-Version: 1.0 Created-By: 1.4.0-rc (Sun Microsystems Inc.) Class-Path: Standard-EJB.jar
<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>
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