Running the WSO2 Enterprise Service Bus (ESB) on the WebLogic Application Server

Archived Content
This article is provided for historical perspective only, and may not reflect current conditions. Please refer to relevant product page for more up-to-date product information and resources.
  • By Asankha Perera
  • 5 Jul, 2008

Versions of Software applicable

  • WSO2 Enterprise Service Bus (ESB) v1.7
  • Weblogic 10

Preparing the WSO2 ESB Web Application for Deployment

1. Extract the WSO2 ESB binary distribution, and use this path as the ESB_HOME in the following steps (e.g. /opt/wso2esb-1.7)

2. Edit the webapp/WEB-INF/web.xml, and set the "esb.home" init parameter of the "ESBStartUpServlet" to the ESB_HOME.

e.g.

    <servlet>
        <servlet-name>ESBStartUpServlet</servlet-name>
        <servlet-class>org.wso2.esb.transport.tomcat.StartUpServlet</servlet-class>
        <!-- The following init parameters are *required* to start the ESB -->
        <!-- They must be configured correctly here, or made available as Java System Properties -->
        <init-param>
            <param-name>esb.home</param-name>
            <param-value>/opt/wso2esb-1.7</param-value>
        </init-param>

3. Add the following element to the end of the webapp/WEB-INF/web.xml, just before the last "</web-app>" element:

<mime-mapping> 
    <extension>xsl</extension> 
    <mime-type>application/xml</mime-type> 
</mime-mapping>

4. Edit the webapp/WEB-INF/classes/conf/axis2.xml, and set absolute path names for the JKS keystores (4 locations)

e.g.

<Location>/opt/wso2esb-1.7/webapp/WEB-INF/classes/conf/identity.jks</Location>

5. Create a file webapp/WEB-INF/weblogic.xml as follows

<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 8.1//EN" "https://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd"> 
<weblogic-web-app> 
    <context-root>/esb</context-root> 
</weblogic-web-app>

6. Edit webapp/WEB-INF/classes/conf/wso2esb.hibernate.cfg.xml, and set the property "connection.url" to an absolute pathname

<property name="connection.url">jdbc:derby://localhost:1528/opt/wso2esb-1.7/database/WSO2ESB_DATABASE;create=true</property>

 

Preparing the WebLogic 10 Server

1. Create a domain (e.g. base_domain) and edit its "bin/setDomainEnv.sh" script to set the PRE_CLASSPATH variable to the antlr JAR shipped with the WSO2 ESB

PRE_CLASSPATH="/opt/wso2esb-1.7/webapp/WEB-INF/lib/antlr-2.7.6rc1.jar"

2. Start the WebLogic domain, login to the console, go to 'Change Center' and click 'Lock & Edit' to configure the ESB

3. Go to 'Domain Structure' -> 'Deployments' and click the 'Install' button

4. Navigate to the ESB_HOME directory and select the webapp directory (e.g. /opt/wso2esb-1.7/webapp)

Deploy the webapp into WebLogic

 

5. Use defaults, or configure the next steps as required, and finish the installation of the ESB into WebLogic 10, and activate the configuration changes from the 'Change Center' -> 'Activate Changes'

6. Select the WSO2 ESB webapp and start the application from 'Domain structure' -> 'Deployments'. Wait for the confirmation messages as shown below

2008-07-06 00:13:54,974 ... INFO ServerManager Ready for processing 
2008-07-06 00:13:58,683 ... INFO ServiceBusManager [ESB] Start request completed

 

Validating the Configuration

1. Login to the WSO2 ESB Admin Console over HTTPS as https://localhost:7002/esb

Note: You will need to enable and configure HTTPS on your WebLogic server if you have not already done so. Go to 'Domain Structure' -> 'Environment' -> 'Servers' and select your server, and select the 'SSL Listen Port Enabled' option to specify the HTTPS port for the 'SSL Listen Port'.

2. Build the SimpleStockQuote sample Web service, and deploy it on the sample Axis2 server shipped with the WSO2 ESB. Refer to https://wso2.org/project/esb/java/1.7/docs/ESB_Samples_Setup.html#Starting

asankha@asankha:/opt/wso2esb-1.7$ cd samples/axis2Server/src/SimpleStockQuoteService/      
asankha@asankha:/opt/wso2esb-1.7/samples/axis2Server/src/SimpleStockQuoteService$ ant 
.....
asankha@asankha:/opt/wso2esb-1.7/samples/axis2Server/src/SimpleStockQuoteService$ cd ../.. 
asankha@asankha:/opt/wso2esb-1.7/samples/axis2Server$ ./axis2server.sh

3. Run the client smoke test

asankha@asankha:/opt/wso2esb-1.7/samples/axis2Client$ ant smoke

You should be able to now see the following on the WebLogic console

2008-07-06 00:15:28,041 [127.0.1.1-asankha] [HttpServerWorker-1] INFO LogMediator To: https://localhost:9000/soap/SimpleStockQuoteService, WSAction: urn:getQuote, 
SOAPAction: urn:getQuote, ReplyTo: https://www.w3.org/2005/08/addressing/anonymous, MessageID: urn:uuid:4CB14022DBAB3AB9611215283527785, Direction: request, 
Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="https://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header xmlns:wsa="https://www.w3.org/2005/08/addressing"><wsa:To>https://localhost:9000/soap/SimpleStockQuoteService</wsa:To><wsa:MessageID>
urn:uuid:4CB14022DBAB3AB9611215283527785</wsa:MessageID><wsa:Action>urn:getQuote</wsa:Action></soapenv:Header><soapenv:Body><m0:getQuote 
xmlns:m0="https://services.samples/xsd"><m0:request><m0:symbol>IBM</m0:symbol></m0:request></m0:getQuote></soapenv:Body></soapenv:Envelope>

 

Resources

1. Sample configuration files used sample.zip

Author

asankha perera is a Software Architect and Product Manager at WSO2. asankha at wso2 dot com