Why do I get oracle.jbo.JboException: JBO-29000 ORA-01882: timezone region not found

Some of you you might have encountered the below shown error while deploying the ADF application on a stand alone weblogic server.

oracle.jbo.JboException: JBO-29000: Unexpected exception caught:
java.sql.SQLDataException, msg=ORA-01882: timezone region  not found
at oracle.jbo.server.OracleSQLBuilderImpl.setSessionTimeZone(OracleSQLBuilderImpl.java:4964)

((OracleConnection) conn).setSessionTimeZone(regionName);

What goes wrong here?

Let us take a step back and see what happens when a client checks out an ApplicationModule to serve it's request. Please note that, on each checkout of an application module from the pool, that application module pool will acquire a connection from the database connection pool and would try to refresh the connection metadata to reflect the current use context. The timezone from the current locale context is set on the database connection by calling

oracle.jdbc.OracleConnection::setSessionTimeZone(regionName)

API Doc Says:
This method is used to set the session time zone. This method must be invoked before accessing any TIMESTAMP WITH LOCAL TIME ZONE data. Upon invocation of this method, the Jdbc driver sets the session timezone of the connection and saves the session timezone so that any TSLTZ data accessed via Jdbc are adjusted using the session timezone.

This call is equivalent to ALTER SESSION SET TIME_ZONE='regionName' command on the database for a session. If the database is not able to find the regionName from V$TIMEZONE_NAMES table( SELECT * from V$TIMEZONE_NAMES ), then you may get the error that I mentioned at the beginning.

Solution

Solution is to get rid of the unsupported default timezone. You can set the timezone either using adf-config.xml or as JVM arguments.
1. Configuring using adf-config.xml
<adf-config ....
<user-time-zone-config xmlns=
"http://xmlns.oracle.com/adf/usertimezone/config">
<user-timezone expression= "EL exp" />
</user-time-zone-config> 
2. Passing as JVM argument
Java -Duser.timezone=Asia/Calcutta


Learn More ...

There are a lot more points like this. If  you are curious to learn the internals of the ADF Business Components and ADF Binding Layer,  the following book is for you - Oracle ADF Real World Developer’s Guide.
More details about this book can be found in this post- http://jobinesh.blogspot.in/2012/07/pre-order-your-copy-of-oracle-adf-real.html

Comments

  1. Hi, I've been struggling with this issue but still can't solve it properly. The error codes are the same but it seams that its coming out from a database link, plus it doesn't happens every time that an AM is getting a connection from the pool.

    java.sql.SQLDataException: ORA-01882: timezone region not found
    ORA-02063: preceding line from DB2
    ORA-02063: preceding 2 lines from DB1

    I have set user.timezone to CST and it seams to work right but my time zone is shifted by 1 hour, if I use America/Mexico_City I start to get the same exception again every now and then.

    Any pointers would be appreciated.

    ReplyDelete
  2. <user-time-zone-config tag - gives the following error- Element user-time-zone-config not expected. Am I missing some class file or reference?please advice.

    ReplyDelete
  3. It is in adf-config.xml which is present in ADF META-INF in the application resources window. I could see this in Jdev 11. I could see this in 11.1.2.3.0.

    ReplyDelete

Post a Comment