Monday, November 7, 2011

How to resolve 'ORA-01882: timezone region not found' when starting WSO2 product servers with Oracle

Have you ever come across the below issue when starting any of the WSO2
Carbon servers,pointing to an Oracle database WITH ojdbc6.jar?Caused by: org.wso2.carbon.user.core.UserStoreException:
Database Error - Cannot create PoolableConnectionFactory
(ORA-00604: error occurred at recursive SQL level 1ORA-01882: timezone region
not found) at org.wso2.carbon.user.core.claim.dao.ClaimDAO.getDialectCount
(ClaimDAO.java:168) at org.wso2.carbon.user.core.common.DefaultRealm.
populateProfileAndClaimMaps(DefaultRealm.java:278) at
org.wso2.carbon.user.core.common.DefaultRealm.init(DefaultRealm.java:109)
at org.wso2.carbon.user.core.common.DefaultRealmService.initializeRealm
(DefaultRealmService.java:240) ... 17 moreCaused by:
org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory
(ORA-00604: error occurred at recursive SQL level 1ORA-01882:
timezone region not found) at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory
(BasicDataSource.java:1549) at org.apache.commons.dbcp.BasicDataSource.createDataSource
(BasicDataSource.java:1388) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
at org.wso2.carbon.user.core.claim.dao.ClaimDAO.getDialectCount(ClaimDAO.java:158)
... 20 more
Well, if you have, all you have to do is, set the below JAVA property
in the terminal that you are running the server on, before starting the
server (+05:30 if you are in Sri Lanka. May vary from the location that
you are located at).export JAVA_OPTS="-Duser.timezone='+05:30'" The above setting will only take effect to the current terminal. Therefore, if you need to set this property permanently, all you have to do is, add it to the wso2server.sh as a new JAVA_OPT property (See below).

Wednesday, March 23, 2011

How to make Java Bench work for HTTPS

Inorder to make Javabench work with HTTPS, you need to follow the below given steps

First extract the cert from the client-truststore of ESB
=========================================================
keytool -export -alias wso2carbon -file wso2carbon.crt -keystore client-truststore.jks

Then import the wso2esb.crt to java's cacert
=============================================
keytool -import -alias wso2carbon -file "/home/ESB/3.0.1/wso2esb-3.0.1/resources/security/wso2carbon.crt" -keystore /opt/software/java/SUN_JDK-1.6/jdk1.6.0_21/jre/lib/security/cacerts