Tuesday, August 18, 2009

WSO2 Governance Registry 3.0.0 installation on Jboss 5.0 with Oracle 10g

WSO2 G-Reg, one of the leading open source SOA governance solution available. The latest release of the WSO2 G-Reg support multiple application servers along with most common production databases.This post list down the steps to deploy G-Reg 3.0.0 on Jboss 5.0 GA using oracle 10g.

Step 1
Download WSO2 G-Reg-3.0.0 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 greg-repo (i.e:- /home/krishatha/greg-repo)

Step 2
Lets refer to your jboss installation directory, JBOSS_HOME. Go to JBOSS_HOME/server/default/deploy directory and create a new folder, wso2greg.war.Now, copy wso2greg-3.0.0/webapps/ROOT/WEB-INF to JBOSS_HOME/server/default/deploy/wso2greg.war

Step3
Now configuring jboss ssl connector as given below.

a. First up, you should probably shut down the JBoss server as you do this step.
In the JBoss directory, there should be a file called server.xml:

JBOSS_HOME/server/default/deploy/jbossweb.sar/server.xml


This file includes information about what web features to turn on when the server starts up.Inside this file, there should be a part that looks like this

<!--<Connector protocol="HTTP/1.1" SSLEnabled="true"
port="8443" address="${jboss.bind.address}"
scheme="https" secure="true" clientAuth="false"
keystoreFile="${jboss.server.home.dir}/conf/chap8.keystore"
keystorePass="rmi+ssl" sslProtocol = "TLS" />-->


b. Make the following changes:

i. Uncomment the block
ii. Change the port to 8443
iii. Change the keystore password to the password used.

The end result should look something like this:

<!-- SSL/TLS Connector configuration using the admin devl guide keystore-->
<Connector protocol="HTTP/1.1" SSLEnabled="true"
port="8443" address="${jboss.bind.address}"
scheme="https" secure="true" clientAuth="false"
keystoreFile="/home/krishatha/greg-repo/resources/security /wso2carbon.jks"
keystorePass="wso2carbon" sslProtocol = "TLS" />


Make sure to give the exact location of wso2carbon.jks as highlighted above.
Note: you can use your own keystore file if required.

Step 4
Now we must do the necessary configurations in a set of config files shipped with WSO2 G-Reg. We will update carbon.xml, axis2.xml, registry.xml, transports.xml and user-mgt.xml which can be found at greg-repo\conf directory.

a. Edit the carbon.xml in greg-repo/conf and set backend sever URL as below.

<ServerURL>https://IP:8443/wso2greg/services/</ServerURL>


it is recommended to use your IP rather than using localhost or hostname.
Note that we have configured JBoss to run on 8443 port.

b. Edit the same carbon.xml and put /wso2greg as the WebContextRoot

<WebContextRoot>/wso2greg</WebContextRoot>


the webcontextroot will be the name you used to create war distribution in JBOSS_HOME/server /default/deploy/wso2greg.war/

c. Then open axis2.xml, 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>


d. Edit the transports.xml as follows. https and http ports of the transport section can be changed as follows.

<transport name="http" class="org.wso2.carbon.server.transports.http.HttpTransport">
<parameter name="port">8080</parameter>



<transport name="https" class="org.wso2.carbon.server.transports.http.HttpsTransport">
<parameter name="port">8443</parameter>


e. Open registry.xml and update DB configurations as follows.

<dbconfig name="wso2registry">
<url>jdbc:oracle:thin:@hostname:1521:SID</url>
<userName>wso2</userName>
<password>wso2</password>
<driverName>oracle.jdbc.driver.OracleDriver</driverName>
<maxActive>80</maxActive>
<maxWait>60000</maxWait>
<minIdle>5</minIdle>
</dbconfig>


Note that the DB configuration used here is for oracle and you can set the DB configuration to any other supported DB accordingly.

f. Open user-mgt.xml and update DB configurations as follows.

<Database>
<URL>jdbc:oracle:thin:@hostname:1521:SID</URL>
<UserName>wso2</UserName>
<Password>wso2</Password>
<Dialect>oracle</Dialect>
<Driver>oracle.jdbc.driver.OracleDriver</Driver>
<maxActive>30</maxActive>
<maxWait>60000</maxWait>
<minIdle>5</minIdle>
</Database>

Note that the DB configuration used here is for oracle and you can set the DB configuration to any other supported DB accordingly.now you have done with configuration changes.

More details on setting up G-Reg with oracle can be found from here.

Step 5
Now you need to copy oracle driver class to the correct location. In my case I have used ojdbc14.jar.


copy ojdbc14.jar into greg-repo/repository/components/extensions


step 6
You also need to copy the wso2greg-3.0.0/lib/log4j.properties file into JBOSS_HOME/server/default/deploy/wso2greg.war/WEB-INF/classes, and JBOSS_HOME/common/lib/log4j.jar to JBOSS_HOME/server/default/deploy/wso2greg.war/WEB-INF/lib

step7
We have completed the required configurations. Now, open a new command window and change the directory to JBOSS_HOME/bin.Define an environment variable called CARBON_HOME and set the path to your greg-repo directory.


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


Start JBoss from the same command window/shell. To start JBoss with the "-b [IP]" option use the following commands.

ex:- run.bat -b 12.34.56.78 OR
./run.sh -b 12.34.56.78


WSO2 G-Reg will be started successfully. You can access the management console using https:\\IP:8443\wso2greg\carbon

Related posts: How to deploy WSO2 WSAS-3.* on JBoss

3 comments:

Abdul Khaliq Gaffar said...

i had followed the same step as mentioned by you .But i faced the following problem
09:13:17,324 INFO [TomcatDeployment] deploy, ctxPath=/wso2greg
09:13:44,745 INFO [STDOUT] [2009-09-03 09:13:44,745] INFO - Starting WSO2 Carbon...
09:13:44,761 INFO [STDOUT] [2009-09-03 09:13:44,761] INFO - Operating System : Windows XP 5.1, x86
09:13:44,761 INFO [STDOUT] [2009-09-03 09:13:44,761] INFO - Java Home : D:\Apps\jdk1.6.0_01\jre
09:13:44,777 INFO [STDOUT] [2009-09-03 09:13:44,777] INFO - Java Version : 1.6.0_01
09:13:44,777 INFO [STDOUT] [2009-09-03 09:13:44,777] INFO - Java VM : Java HotSpot(TM) Server VM 1.6.0_01-b06,Sun Microsystems Inc.

09:13:44,777 INFO [STDOUT] [2009-09-03 09:13:44,777] INFO - Carbon Home : D:\appServer\greg-repo
09:13:44,777 INFO [STDOUT] [2009-09-03 09:13:44,777] INFO - Java Temp Dir : C:\DOCUME~1\s726580\LOCALS~1\Temp\
09:13:44,777 INFO [STDOUT] [2009-09-03 09:13:44,777] INFO - User : s726580, en-GB, Asia/Muscat
09:13:50,324 INFO [STDOUT] [2009-09-03 09:13:50,324] FATAL - Cannot start User Manager Core bundle
java.lang.NullPointerException
at org.wso2.carbon.user.core.internal.Activator.start(Activator.java:60)
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)
09:13:50,402 INFO [STDOUT] [2009-09-03 09:13:50,402] FATAL - Cannot start User Manager Core bundle
java.lang.NullPointerException
at org.wso2.carbon.user.core.internal.Activator.start(Activator.java:60)
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.setBundleSL(StartLevelManager.java:691)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:442)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:220)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:330)

Krishantha Samaraweera said...

Hi Abdul,

Without going any further can I check your configuration files. if it is possible please attach following files to the below mentioned forum via post.

registry.xml
user-mgt.xml
axis2.xml
transports.xml

Please subscribe to Governance forum [1] and send your matter there. So we will be able to discuss the matter with community experts.

Thanks,
Krishantha.

[1] http://wso2.org/forum/351

Krishantha Samaraweera said...

please attach the carbon.xml as well.

Thanks,
Krishantha.