2

I swapped out my ojdb6.jar file in tomcat/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="jdbcracle: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.

Nathan Hughes
  • 94,330
  • 19
  • 181
  • 276
Jose Martinez
  • 11,452
  • 7
  • 53
  • 68
  • 1
    http://stackoverflow.com/questions/9156379/ora-01882-timezone-region-not-found – Jay Apr 28 '14 at 14:44
  • Why the downvote? I searched for ojdbc7 and did not come across this. – Jose Martinez Apr 28 '14 at 14:54
  • If someone now does a similar upgrade to ojdb7 and they get this problem and search for ojdbc upgrade then they will come across this post and it might help them. This is the context in which I asked the question, basically why did the change cause this problem. – Jose Martinez Apr 28 '14 at 14:57

1 Answers1

7

Try adding VM arg

-Doracle.jdbc.timezoneAsRegion=false
assylias
  • 321,522
  • 82
  • 660
  • 783
jgitter
  • 3,396
  • 1
  • 19
  • 26
  • Wow it worked. You genius you. Can you explain what that did? – Jose Martinez Apr 28 '14 at 14:51
  • @Jose: read the post Jay linked to in the comments, the explanation is there. – Nathan Hughes Apr 28 '14 at 14:52
  • I googled and found the property setting to turn that feature off. I can't really claim to be a genius. – jgitter Apr 28 '14 at 14:56
  • @Nathan, none of those comments go over ojdb7.jar. – Jose Martinez Apr 28 '14 at 15:06
  • 1
    Look here in the API docs. I don't know which version of Oracle you're using so I guessed. That setting hasn't changed much. http://download.oracle.com/otn_hosted_doc/jdeveloper/905/jdbc-javadoc/oracle/jdbc/OracleConnection.html#CONNECTION_PROPERTY_TIMEZONE_AS_REGION – jgitter Apr 28 '14 at 15:29