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).

17 comments:

shashi said...

thank you very much, you are great!!!!!!

Umayanga Suran Jayathilaka said...

Help from a source close to home! Thanks! :)

AMAL GEEK said...

Really helpful, Cheers !

Chathuranga Withana said...

Thank you very much...

amit malpure said...

I am facing the same issue while connecting to oracle database. I set JAVA_OPTS="-Duser.timezone='+05:30'" on command prompt and run my connection program. but still its throwing same error. Can you help?

Evan said...

Hi Amit,

Have you given the command correctly? I see an extra quote in the command that you have given in the comment.

Could you try once again with - JAVA_OPTS='-Duser.timezone=+05:30' instead?

Regards,
Evanthika

Pavithra said...

Really helpful... Thanks a lot

Yumani Ranaweera said...

tx alot !!!!

Suresh said...

Local Sever Working Fine . but if you deploy into Weblogic server getting as problem. how will solve the problem?

Suresh Attanayake said...

Hi, it worked after using ojdbc14.jar instead the ojdbc6.jar. Thanks for the tip.

Lahiru Sandaruwan said...

Thanks for the post. I tried same in windows machine with Vista. For that, we can add
set JAVA_OPTS=%JAVA_OPTS% -Duser.timezone='+05:30'

to the wso2server.bat file.

Thanks.

jhk said...

Hi Evanthika. Great thanks to you! We solved a similar issue with your advice. Rgds, Henri

jhk said...

Hi Evanthika and thanks! We solved a similar issue with your advice :) rgds, Henri

Malintha Adikari said...

Thank you.

Dhanushka Jayathilaka said...

thank you

Dhanushka Jayathilaka said...

thank you

Dhanushka Jayathilaka said...
This comment has been removed by a blog administrator.