How to deploy WSAS-3.X on Oracle WebLogic 10.3

WSO2 DOES NOT ENCOURAGE INSTALLING WSO2 APPLICATION SERVER (previously known as WSAS) ON TOP OF OTHER APPLICATION SERVERS. WSO2 HAS DECIDED TO DROP SUPPORT FOR WEBAPP DEPLOYMENT MODE OF THE WSO2 PLATFORM AND PRODUCTS.






Once Azeez has written a 10 minute guide to installing WSO2 WSAS on Weblogic server. That guide explains the steps to deploy 2.X family of WSAS on weblogic. With the introduction of WSO2 Carbon platform in December 2008, WSO2 WSAS is no longer distributed as a separate war distribution. Hence, the instructions given in that document is not applicable when deploying WSO2 WSAS-3.X series on Oracle WebLogic server.
Since all WSO2 java products are built on Carbon platform, users can configure running WSO2 products on any application server using a set of components included in binary distributions. I have already explained the steps to deploy WSO2 BPS on tomcat and WSO2 WSAS-3.X on Jboss.

This post describes the steps to deploy WSO2 WSAS-3.X on WebLogic 10.3

Step1

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)

Step 2
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 it is 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.

Step 3

We need to enable SSL in weblogic server. 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. Select AdminServer.
Click on KeyStores tab. Configure keystores as shown below.



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.

Step 4

Now, we should update the set of config files shipped with WSO2 WSAS. 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.

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>

Step 5

We have completed the required configurations and we can deploy WSO2 WSAS on weblogic now.
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.



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

Note:-
1. In order to set the log4j logs, you may copy log4j.properties file in the extracted WSO2WSAS-3.X directory to wsas-repo\wso2wsas\WEB-INF\classes

2. If you want to deploy JaxWS services in WSAS/WebLogic platform, you should do the following configuration to avoid a class casting issue (https://wso2.org/jira/browse/CARBON-4835)

- Remove weblogic.jar/META-INF/services/com.sun.xml.ws.api.wsdl.writer.WSDLGeneratorExtension & restart Carbon

3. 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 WSAS.




Comments

Harshit Kapoor said…
It is a good walk through, however there is a typo error at Step 3.

Instead of
Custom Identity Keystore Passphrase = wsocarbon

it should be
Custom Identity Keystore Passphrase = wso2carbon
Charitha said…
Thank you very much Harshit, i have corrected it
Harshit Kapoor said…
Charitha,
Good to see you responsive!
I have followed the steps as mentioned in this post, however, when I access carbon management console I get the following:

"ProxyServlet: /wso2wsas/carbon"

I do not get anything else in the browser.

Could you help?
Charitha said…
Hi Harshit,
Did you follow the extra 3 steps specified under "notes" section at the bottom of this post? Please let me know

Regards
Charitha
Charitha said…
Harshit,
Actually out of the 3 extra steps given under notes, you should do the step 3, "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 WSAS."

Regards
Charitha
Harshit Kapoor said…
Charitha,

I am new to Weblogic.
Could you point me top the specific location where I have to place the the jar files?
Charitha said…
Hi,
place these jars at \bea\jdk160_05\jre\lib\ext if you are running weblogic with Sun jdk.

Regards
Charitha
Harshit Kapoor said…
Charitha,

I have place these jars in lib/ext of JDK and Jrockit. I have placed them in domain_name/lib also, however it did not work. IE still give me 404 error.
Charitha said…
Hi,
Could you please post me server log? You must copy log4j.properties file in the extracted WSO2WSAS-3.X directory to wsas-repo\wso2wsas\WEB-INF\classes to get the logs.
Also, make sure to restart the server after copying those 3 jars.

Regards
Charitha
Harshit Kapoor said…
his can lead to a show code vulnerability.>
[2009-12-17 17:45:59,291] INFO - Registry Mode : READ-WRITE
[2009-12-17 17:45:59,291] INFO - Starting WSO2 Carbon...
[2009-12-17 17:45:59,291] INFO - Operating System : Windows XP 5.1, x86
[2009-12-17 17:45:59,291] INFO - Java Home : D:\INSTAL~1\bea\JDK160~1\j
re
[2009-12-17 17:45:59,291] INFO - Java Version : 1.6.0_05
[2009-12-17 17:45:59,307] INFO - Java VM : Java HotSpot(TM) Client VM
10.0-b19,Sun Microsystems Inc.
[2009-12-17 17:45:59,307] INFO - Carbon Home : D:\installation\wsas\wsas-
repo
[2009-12-17 17:45:59,307] INFO - Java Temp Dir : C:\DOCUME~1\HKAPOO~1.CIB\L
OCALS~1\Temp\
[2009-12-17 17:45:59,307] INFO - User : hkapoor, en-US, Asia/Calcu
tta
[2009-12-17 17:46:00,588] INFO - Starting Carbon initialization...
[2009-12-17 17:46:00,682] INFO - org.wso2.carbon.core.deployment.DeploymentInt
erceptor
[2009-12-17 17:46:00,682] FATAL - WSO2 Carbon initialization Failed
org.apache.axis2.deployment.DeploymentException: org.wso2.carbon.core.transports
.smtp.SMTPFaultHandler
at org.apache.axis2.deployment.util.Utils.loadHandler(Utils.java:148)
at org.apache.axis2.deployment.AxisConfigBuilder.processPhaseList(AxisCo
nfigBuilder.java:553)
at org.apache.axis2.deployment.AxisConfigBuilder.processPhaseOrders(Axis
ConfigBuilder.java:584)
at org.apache.axis2.deployment.AxisConfigBuilder.populateConfig(AxisConf
igBuilder.java:147)
at org.wso2.carbon.core.CarbonAxisConfigurator.populateAxisConfiguration
(CarbonAxisConfigurator.java:265)
at org.wso2.carbon.core.CarbonAxisConfigurator.getAxisConfiguration(Carb
onAxisConfigurator.java:184)
at org.apache.axis2.context.ConfigurationContextFactory.createConfigurat
ionContext(ConfigurationContextFactory.java:64)
at org.wso2.carbon.core.CarbonConfigurationContextFactory.createNewConfi
gurationContext(CarbonConfigurationContextFactory.java:76)
at org.wso2.carbon.core.init.CarbonServerManager.initializeCarbon(Carbon
ServerManager.java:308)
at org.wso2.carbon.core.init.CarbonServerManager.removePendingItem(Carbo
nServerManager.java:221)
at org.wso2.carbon.core.init.OSGiAxis2ServicesListener.bundleChanged(OSG
iAxis2ServicesListener.java:82)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEv
ent(BundleContextImpl.java:916)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventM
anager.java:220)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(Even
tManager.java:330)
Caused by: java.lang.ClassNotFoundException: org.wso2.carbon.core.transports.smt
p.SMTPFaultHandler
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(Bundl
eLoader.java:489)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.
java:405)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.
java:393)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(De
faultClassLoader.java:105)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at org.apache.axis2.util.Loader.loadClass(Loader.java:261)
at org.apache.axis2.util.Loader.loadClass(Loader.java:229)
at org.apache.axis2.deployment.util.Utils.loadHandler(Utils.java:115)
... 13 more
Charitha said…
Hi,
Did you enable SMTP transport (mail transport) in wsas_repo\conf\axis2.xml by any chance?

Regards
Charitha
Harshit Kapoor said…
Thankyou for being vey responsive.

I did not enable SMTP transport in Axis2.xml, by default it is commented out, Axis2.xml also has SMTPFaultHandler configuration. By default this configuration is enabled. Now I have commented it out and I am able to see console.
Thanks again.

I am facing problem with using oracle driver, log say ClassNotFound for OracleDriver. I have placed Classes12.jar in ext, lib of jdk and jrockit. I have placed the same in domain/wsas/lib folder as well. Can you help?
Charitha said…
Hi Harshit,
It is great to know that you were able to make it working. All third party jars such as oracle drivers should be placed at CARBON_HOME/repository/components/lib. Please remove them from lib/ext directories and copy to the above folder and restart.

Regards
Charitha
Roger said…
Hi,

very could help for setting up the wso2 for wls 10.3. I can log in into the Management Console of ws02 esb. I can add a new user. But when I like to add a new proxy service, I get the following error:

The following error details are available. Please refer logs for more details.
org.apache.axis2.AxisFault: Cannot get all services. Backend service may be unavailable
at org.wso2.carbon.service.mgt.ui.ServiceAdminClient.handleException(ServiceAdminClient.java:411)
at org.wso2.carbon.service.mgt.ui.ServiceAdminClient.getAllServices(ServiceAdminClient.java:83)
at org.apache.jsp.service_002dmgt.index_jsp._jspService(index_jsp.java:140)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)

...

at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: org.apache.axis2.AxisFault: Exception occurred while trying to invoke service method listServiceGroups
at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:518)


I also have this message always on WLS console:
[2010-01-28 09:28:57,539] WARN - StartupFinalizerServiceComponent Waiting for required OSGi services: org.wso2.carbon.mediation.initializer.services.SynapseEnvironmentService,


Any Idea?

best regards,

Igor
Charitha said…
Hi Igor,
This WARN can be ignored, it does not affect functionalities. However. do you always get "AxisFault: Cannot get all services. Backend service may be unavailable" error or does it occur randomly?

Regards
Charitha
pauli said…
Hi Charitha,

I've tried to follow your instructions but I'm seeing a similar error to Harshit. When i navigate to the url:

https://localhost:7002/wso2wsas/carbon

I see the message 'https://localhost:7002/wso2wsas/carbon'.

I can also see the following error message in the logs:

[2010-02-22 13:30:21,481] ERROR - Database Error - Cannot create JDBC driver of class 'org.h2.Driver' for connect URL 'dbc:h2:C:\wsas\wsas-repo\database\WSO2CARBON_DB;create=true' {org.wso2.carbon.user.core.util.DatabaseUtil}
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'org.h2.Driver' for connect URL 'dbc:h2:C:\wsas\wsas-repo\database\WSO2CARBON_DB;create=true'
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
at org.wso2.carbon.user.core.claim.ClaimDAO.getDialectCount(ClaimDAO.java:140)
at org.wso2.carbon.user.core.internal.Activator.exposeDefaultRealmAsService(Activator.java:337)
at org.wso2.carbon.user.core.internal.Activator.start(Activator.java:197)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:782)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:773)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:754)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:352)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:370)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1068)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:557)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:464)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:248)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:445)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:220)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:330)
Caused by: java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getDriver(DriverManager.java:264)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1143)
... 17 more

Can you can help?
Charitha said…
Hi Pauli,
Your jdbc url is wrong. According to the exception, your jdbc url started with "dbc:h2" but it should be "jdbc:h2".
Please correct it and try again.

Charitha
pauli said…
Doh! Thanks Charitha. That got me further but i'm now seeing this error?

[2010-02-22 16:34:29,872] ERROR - Error rendering tile
java.io.IOException: Error including path '/admin/layout/template.jsp'. javax.xm
l.parsers.FactoryConfigurationError: Provider weblogic.xml.jaxp.RegistryDocument
BuilderFactory not found
at org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(S
ervletTilesRequestContext.java:201)
at org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(
ServletTilesRequestContext.java:185)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.
java:419)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.
java:370)
at org.wso2.carbon.ui.action.ActionHelper.render(ActionHelper.java:53)
at org.wso2.carbon.ui.TilesJspServlet.service(TilesJspServlet.java:86)

bty, thank you for the quick response.

paul
Charitha said…
Hi,
What is the WSO2 WSAS version you are trying to deploy?

Regards
Charitha

Popular posts from this blog

WSO2 Stratos - Introducing WSO2 middleware Platform as a Service (PaaS)

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