• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

exception while trying to upgrade oto ojdbc7.jar from ojdb6.jar

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I swapped out my ojdb6.jar file in tomat/lib with ojdb7.jar. Turned on Tomcat and I get the following error when trying to use it...

Could not get JDBC Connection; nested exception is org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (ORA-00604: error occurred at recursive SQL level 1
ORA-01882: timezone region not found

here is the connection pool configuration I am using....

<Resource auth="Container" driverClassName="oracle.jdbc.driver.OracleDriver" type="javax.sql.DataSource"
maxActive="25" maxIdle="25" maxWait="2000"
name="jdbc/getcontacts"
timeBetweenEvictionRunsMillis="1000"
minEvictableIdleTimeMillis="30000"
removeAbandoned="true"
removeAbandonedTimeout="30000"
logAbandoned="true"
username="xxxx" password="xxxxx"
validationQuery="Select 1 from dual" connectionProperties="defaultRowPrefetch=10000"
url="jdbc:oracle:thin:@//xxxxx.net/xxxxx" />



Any idea what could be causing this? We are using Oracle database 11g.

/usr/jdk7/bin/java -version
java version "1.7.0_17"
Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)


Any help would be greatly appreciated. When I put the ojdb6.jar file back and remove the ojdb7.jar file everything works fine.


thanks
jose
 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch, José!

This is an Oracle message and one that makes me wonder if the database itself needs to be configured to handle timezones properly. I'm bouncing this over to the Oracle forum where it's more likely somebody knows for sure.
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you try to search on the message (ORA-01882: timezone region not found), you'll get lots of interesting results.

It looks like they changed the way the JDBC driver looks up the timezone information between 11.1 and 11.2 versions of the driver. Before that, the current timezone was converted to the GMT+offset, which means that the daylight saving information was lost. The fix in 11.2 generally works, but if the database doesn't know the timezone set on your client, this error occurs (the database time zone definitions are probably older than those in your application).

Apparently you have several possibilities:

1) Change the timezone in your Java application to something the database knows (just add something like -Duser.timezone=GMT to your JVM arguments).

2) Set the TZ environment variable to a timezone to be used by clients connecting to Oracle database (I'd suggest looking up the information about the TZ environment variable in Oracle documentation)

3) Set the connection property oracle.jdbc.timezoneAsRegion to false. This reverts to the old style of session timezone behavior.

Note: this is just what I found on the web. I haven't tried any of those solutions myself.
 
reply
    Bookmark Topic Watch Topic
  • New Topic