How to run WSAS-v3.0-beta2 on Apache Tomcat

Wednesday, December 31, 2008

WSAS-v3.0-beta2 is the first WSAS release which runs on the brand new WSO2 Carbon platform. Just like the previous releases of WSAS, this release also capable of running as a standalone server and on top of other well known application servers. A step by step procedure to run it on Apache Tomcat is explained below.

Step 1 : Download WSAS-v3.0-beta2 binary distribution and extract it (say you extracted it to /home/foo/wsas). If you don't have an already extracted Apache Tomcat server, download and extract it too (say you extracted it to /home/foo/tomcat). Tomcat version 5.5.x or higher is recommended.

Step 2 : Copy 'repository', 'resources' and 'conf' directories from extracted WSAS folder and paste them into a separate folder (say /home/foo/wsas-home).

Step 3 : Set an environment variable of the name CARBON_HOME with the above folder path as the value (according to above example, CARBON_HOME=/home/foo/wsas-home). Then set the environment variable CATALINA_HOME with extracted tomcat folder path as the value (CATALINA_HOME=/home/foo/tomcat).

Note : If you want, you can use the folder to which you extracted WSAS (/home/foo/wsas), as WSAS_HOME without copying the above folders into a separate location.

Step 4 : Create a folder inside the 'webapps' folder (say with the name 'wsastest') of extracted Tomcat and copy the WEB-INF folder which is inside /webapps/ROOT folder of the extracted WSAS in to the created folder (copy /home/foo/wsas/webapps/ROOT/WEB-INF folder into /home/foo/tomcat/webapps/wsastest folder).

Step 5 : Open the server.xml file which is inside the conf folder of the extracted Tomcat (/home/foo/tomcat/conf/server.xml). Insert the following 'Connector' entry inside the 'Service' tag to set the HTTPS port.


Connector port="8443" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile = "/home/foo/wsas-home/resources/security/wso2carbon.jks"

Note : You can use any port instead of 8443 and you have to correctly set the path to 'keystoreFile' according to your CARBON_HOME.

Step 6 : Open the carbon.xml file which is inside CARBON_HOME/conf folder. It contains a ServerURL entry as shown below (line 47).
Edit the port and add the correct context. According to the example above, it should be as follows.

Step 7 : Open the axis2.xml file which is inside CARBON_HOME/conf folder. Go to line number 145 and change the http port to Tomcat http port which is 8080 (default port).
Then go to line number 160 and change the https port to what you have given above (8443).

Step 8 : Open a terminal and move into the bin folder of the extracted Tomcat and start the server using the following command.
On Windows : catalina.bat run
On Linux : sh run

Step 9 : Open your web browser and access the URL https://localhost:8443/wsastest/carbon. You will be directed to the WSAS home page through which you can log into the system.

Known Issues

  • When the server starts up, you will see and exception regarding a data services sample. Please ignore it for now.
  • Shutdown/restart option provided in the WSAS UI doesn't work in Tomcat. Therefore please use the shutdown option of Tomcat to shutdown and restart WSAS.


Mark said...

I have followed your directions and am trying to deploy a data service (.ds) file which defines an Oracle data source. When I start Tomcat, I get an exception saying that the service could not be deployed because it can't find the Oracle JDBC driver class:
Caused by:
org.apache.axis2.AxisFault: Error locating class oracle.jdbc.driver.OracleDriver
at org.wso2.dataservices.DBCPConnectionManager.connectToDB(
at org.wso2.dataservices.DBCPConnectionManager.[init](
... 15 more
Caused by: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
at java.lang.ClassLoader.findClass(
at java.lang.ClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at java.lang.ClassLoader.loadClassInternal(
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(
at org.wso2.dataservices.DBCPConnectionManager.connectToDB(

Any help would be appreciated.

Mark said...

BTW, I have tried putting the ojdbc14.jar file in the WSAS WEB-INF/lib directory under tomcat, as well as the CARBON_HOME/lib/extensions directory. It doesn't seem to find it anywhere I put it.