2009/12/19
19 Dec, 2009

WSO2 WSAS-3.X deployment on Oracle WebLogic Server

  • Charitha Kankanamge
  • Senior Manager, Support - WSO2

Introduction

WSO2 Web Services Application Server (WSAS) can be deployed on most of the popular application servers with simple set of configuration steps. With the introduction of WSO2 Carbon platform in December 2008, WSO2 WSAS  is no longer distributed as a separate war distribution. Users are supposed to download the binary distribution and build a war or deploy in exploded mode depending on the supported deployment modes of the application servers. In this post we will look in to the steps of deploying WSO2 WSAS-3.X versions on Oracle WebLogic application server.

Applies To

WSO2 WSAS 3.0.0 or later
Oracle WebLogic 10.3 or later

Table of Contents

We will look in to the following five steps during this tutorial.

1. Preparing WebLogic server

2. Building a deployable artifact

3. Configuring SSL on WebLogic

4. Updating WSO2 WSAS configuration files

5. Installing WSO2 WSAS on WebLogic

 

1. Preparing WebLogic Server

As the first step, we need to create a new domain in WebLogic server so that we can isolate WSO2 WSAS from the other deployments. Create a new weblogic domain by running config.sh {bat} located at WebLogic_HOME/wlserver_10.3/common/bin directory.
Lets assume the new domain is wsas.
Access your weblogic domain direcrtory and start weblogic (Go to WebLogic_HOME/user_projects/domains/wsas/bin and run startWebLogic.cmd)

2. Building a deployable artifact

Now, we need to build an artifact from WSO2 WSAS binary distribution so that it can be deployed on WebLogic server. Download the latest version of WSO2 WSAS-3.X from here. Extract the downloaded zip into a directory. Copy conf, database, repository and resources directories in to a new folder. Here after, we will refer to this new directory as wsas-repo (i.e:- C:\wsas\wsas-repo)
Also, create a new directory, wso2wsas and copy the WEB-INF directory located at the webapps/ROOT directory of the downloaded WSO2 WSAS-3.X to wso2wsas directory. Now, your wsas-repo should have five sub directories - conf, database, repository, resources and wso2wsas.
wso2wsas will be used as the webapp root directory and we will point to that during the installation process.

In order to enable WSAS logging inside WebLogic, you should copy log4j.properties file in the extracted WSO2WSAS-3.X directory to wsas-repo\wso2wsas\WEB-INF\classes. Also, Make sure to copy xalan-*.jar, xercesImpl-*.jar and xml-apis-*.jar from the lib/endorsed directory of the extracted WSAS binary distribution to weblogic endorsed directory before you start WebLogic Server.

3. Configuring SSL on WebLogic

We must enable SSL in weblogic server since the interactions with WSO2 WSAS will be performed on HTTPS. Log in to weblogic administration console (You should have configured username and password for admin console when creating your WebLogic domain) and go to Environment --> servers. Then,  select AdminServer.
Click on KeyStores tab. Configure keystores as shown below.

SSL configuration on WebLogic

Keystore = Custom Identity & Custom Trust

Custom Identity Keystore = C:\wsas\wsas-repo\resources\security\wso2carbon.jks

Custom Identity Keystore Type = JKS

Custom Identity Keystore Passphrase = wso2carbon

Confirm Custom Identity Keystore Passphrase = wso2carbon

Custom Trust Keystore = C:\wsas\wsas-repo\resources\security\wso2carbon.jks

Custom Trust Keystore Type = JKS

Custom Trust Keystore Passphrase = wso2carbon

Confirm Custom Trust Keystore Passphrase = wso2carbon

Now, select SSL tab and enter the following values.

Identity and trust locations = keystores

Private Key Alias = wso2carbon

Private Key Passphrase = wso2carbon

Confirm Private Key Passphrase = wso2carbon

Save the configuration and go to the General tab. Select the check box next to "SSL listen port enabled".
Now we have configured the necessary changes to enable SSL on weblogic. Lets continue with deploying WSO2 WSAS on weblogic.

4. Updating WSO2 WSAS configuration files

WSO2 WSAS is provided with a set of configuration files in WSAS_HOME (root of the binary distribution)/conf directory. These files are used to update the ports, database settings, web application context roots etc.. We will update carbon.xml, axis2.xml, registry.xml and user-mgt.xml which can be found at the above wsas-repo\conf directory.
First, open carbon.xml and update the ServerURL element as follows.

<ServerURL>https://localhost:7002/wso2wsas/services/</ServerURL>

Note that we have configured weblogic to run on 7002 port.

Since we deploy WSO2 WSAS on WebLogic server on non-root webContext, update WebContextRoot element as follows.

<WebContextRoot>/wso2wsas</WebContextRoot>

Save and close carbon.xml.

Open registry.xml and update DB URL as follows.

<url>jdbc:h2:C:\wsas\wsas-repo\database\WSO2CARBON_DB;create=true</url>

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

<url>jdbc:h2:C:\wsas\wsas-repo\database\WSO2CARBON_DB;create=true</url>

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

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">7001</parameter>

</transportReceiver>

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

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

5. Installing WSO2 WSAS on WebLogic

We have completed the required configurations and now we are ready to deploy WSO2 WSAS on weblogic.
First, shutdown the weblogic server instance if it is still running.
open a new command window and change the directory to WebLogic_HOME/user_projects/domains/wsas/bin.
Define an environment variable called CARBON_HOME and set the path to your wsas-repo directory.

In windows; set CARBON_HOME=C:\wsas\wsas-repo

In linux; export CARBON_HOME=\home\user\wsas\wsas-repo

Run startWebLogic.cmd

Once the server is started successfully, log in to weblogic administration console using https://localhost:7002/console
Then, go to the Summary of Deployments page and select Install.
Locate the deployment root by selecting C:\wsas\wsas-repo\wso2wsas directory. (web app root directory will be shown with a radio button option as follows.)

Application Deployment of WebLogic Server

Click on next to proceed through the wizard and continue with the default settings.
Once the deployment is successful, save the configuration and select start --> servicing all requests
Now, we are done with the deployment. You could access the management console using https:\\localhost:7002\wso2wsas\carbon

Notes:-

If you want to deploy JaxWS services in WSAS/WebLogic platform, you should remove weblogic.jar/META-INF/services/com.sun.xml.ws.api.wsdl.writer.WSDLGeneratorExtension & restart Carbon to avoid a class casting issue (https://wso2.org/jira/browse/CARBON-4835)
 

Summary

In this tutorial, we looked in to the steps of deploying WSO2 WSAS-3.X versions on Oracle WebLogic Server. As you noted, with s few configuration steps, we can install WSO2 WSAS on WebLogic server. For the older versions (pre-Carbon versions) of WSO2 WSAS, you could follow the 10 Minute Guide to Installing WSO2 WSAS on WebLogic tutorial written by Afkham Azeez. 

 

About Author

  • Charitha Kankanamge
  • Senior Manager, Support
  • WSO2 Inc