How to deploy WSO2 BPS on Apache Tomcat

WSO2 DOES NOT ENCOURAGE INSTALLING WSO2 BPS ON TOP OF OTHER APPLICATION SERVERS. WSO2 HAS DECIDED TO DROP SUPPORT FOR WEBAPP DEPLOYMENT MODE OF THE WSO2 PLATFORM AND PRODUCTS.





WSO2 Business Process Server (BPS) -1.0 is the latest member of WSO2 SOA platform. I have demonstrated a basic scenario using WSO2 BPS standalone distribution in a previous blog post. WSO2 BPS (and all other carbon based products) can be deployed in most of the servlet containers with a few configuration steps. Lets deploy WSO2 BPS on Apache tomcat 6.*.

Step 1
Download WSO2 BPS-1.0 from here. Extract the downloaded zip into a directory. Copy conf, database, repository and resources directories in to a new folder. Say it is carbon-repo (i.e:- C:\bps\carbon-repo)
Also, create a new directory, lib\extensions under carbon-home.

Step 2
Lets refer to your tomcat installation directory, CATALINA_HOME. Go to CATALINA_HOME\webapps directory and create a new folder, bps.
Now, copy wso2bps-1.0\webapps\ROOT\WEB-INF to CATALINA_HOME\webapps\bps

Step3
We need to enable https in tomcat. Therefore, edit CATALINA_HOME\conf\server.xml by adding the following entry.

<Connector port="8443" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true" SSLEnabled="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile = "C:\bps\carbon-repo\resources\security\wso2carbon.jks"
keystorePass="wso2carbon"/>

Make sure to give the exact location of wso2carbon.jks as highlighted above.

Step 4
We have done the configurations required in tomcat. Now, we must do the necessary configurations in a set of config files shipped with WSO2 BPS. We will update carbon.xml, axis2.xml, registry.xml and user-mgt.xml which can be found at carbon-repo\conf directory.
First, open carbon.xml and update the ServerURL element as follows.

<ServerURL>https://localhost:8443/bps/services/</ServerURL>

Note that we have configured tomcat to run on 8443 port.
Save and close carbon.xml.

Open registry.xml and update DB URL as follows.
<url>jdbc:derby:C:/bps/carbon-repo/database/WSO2CARBON_DB;create=true</url>

Now, open user-mgt.xml and update database URL as follows.

<url>jdbc:derby:C:/bps/carbon-repo/database/WSO2CARBON_DB;create=true</url>

Make sure to specify the absolute path of the WSO2CARBON_DB in both of the above elements.

It is required to change the contextRoot in the service path of axis2.xml. Change it to match with the web application directory name we have given in step2. In our case, it is bps.

<parameter name="contextRoot">/bps</parameter>

We must change the http and https ports in In Transports section of axis2.xml as follows.

<transportReceiver name="http"
class="org.wso2.carbon.core.transports.http.HttpTransportListener">
<parameter name="port">8080</parameter>

</transportReceiver>

<transportReceiver name="https"
class="org.wso2.carbon.core.transports.http.HttpsTransportListener">

<parameter name="port">8443</parameter>
</transportReceiver>

Step 5
We have almost completed the required configurations. Before starting tomcat with those changes, we need to do one more change. Due to a bug in BPS-1.0, we must copy org.wso2.carbon.geronimo.jta.1.1.spec-1.1.jar (which is available at the lib\extensions directory of the WSO2 BPS binary distribution) to carbon-repo\lib\extensions and CATALINA_HOME\webapps\bps\WEB-INF\lib directories.

Step 6
Now, open a new command window and change the directory to CATALINA_HOME/bin.
Define an environment variable called CARBON_HOME and set the path to your carbon-repo directory.

In windows; set CARBON_HOME=C:\bps\carbon-repo
In linux; export CARBON_HOME=\home\user\bps\carbon-repo

Start tomcat from the same command window/shell.
catalina.bat run

WSO2 BPS will be started successfully. You can access the management console using https:\\localhost:8443\bps\carbon

Comments

Data Cube said…
Hey, I like your blog information, keep up the good posting! But don't you consider default blogger.com themes boring? Well, I have little advice for you, check out WebToolGallery.com for free custom blogger templates. :)

Popular posts from this blog

Common mistakes to avoid in WSO2 ESB - 1 - "org.apache.axis2.AxisFault: The system cannot infer the transport information from the URL"

Working with HTTP multipart requests in soapUI

How to configure soapUI to send HTTP chunked encoded requests