Thursday, April 16, 2009

Deploying Apache Axis2 / Rampart on JBoss

Recently I noticed some users raising questions on how to deploy Apache Axis2 / Rampart on JBoss and wanted to give it a try. I was able to deploy Apache Axis2 / Rampart on Jboss without much a problem and was able to successfully deploy and invoke a secure web service. Here are the steps.

1.) Download the latest distributions of the required software.
Note : I am using JDK 1.5.0_14.

2.) Extract the jboss-5.0.1.GA.zip to a preferred location on your hard drive. We will refer to this folder as JBOSS_HOME from now onwards.

3.) Deploy Axis2 on JBoss.

We will use the Exploded WAR Deployment. Extract the axis2.war file in to /server/default/deploy directory. By default it will be extracted to a directory named “axis2” and you need to rename it to “axis2.war”. Then delete xml-apis-1.3.04.jar and xercesImpl-2.8.1.jar from from Axis2 war due to the issue mentioned here.

4.) Deploy Rampart.

Copy the jar libraries in lib directory of Rampart binary distribution to WEB-INF/lib directory of axis2.war. Also copy the bouncycastle library to WEB-INF/lib directory.
Copy the rampart-1.4.mar and rahas-1.4.mar to WEB-INF/modules directory.
The deployment structure is illustrated below.

And that's it. Now you can deploy the secure services by copying them to WEB-INF/services directory.

If you want to learn how to secure Axis2 web services using Apache Rampart module, following tutorials may help you to get started.