Advertisements
RSS

Weblogic and different version Oracle JDBC driver

26 Jul

When trying to configure a new JDBC Datasource in Weblogic the following error was shown in the console: java.lang.ArrayIndexOutOfBoundsException: 7

The Weblogic server log shows the following trace:

####       <> <>   	at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:989)
	at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:292)
	at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:508)
	at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:203)
	at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33)
	at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:510)
	at com.bea.console.utils.jdbc.JDBCUtils.testConnection(JDBCUtils.java:505)
	at com.bea.console.actions.jdbc.datasources.createjdbcdatasource.CreateJDBCDataSource.testConnectionConfiguration(CreateJDBCDataSource.java:458)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	....

After some debugging the source of the problem was an old Oracle Database version (8.1.7) used in the test environment. Apparantly the combination with Weblogic 10.3.3 & Oracle JDBC driver (ojdbc6.jar) is not supported/allowed/working. This old database version was not used in the new Acceptance and Production environment so we needed a simple work-around.

We decided to try and use an old version of the ojdbc driver (1.4) instead of the default version (6).

So in our setDomainEnv.cmd we defined: set PRE_CLASSPATH=/oracle/library/ojdbc14.jar
As we had a dedicated Weblogic Test Domain we could configure it like this for the whole domain.

After restarting the Managed Server we could see in the logging that the driver has been loaded first:
java.class.path = /oracle/library/ojdbc14.jar;/oracle/ofmw11113/patch_wls1033/…………

And after restart configuring the JDBC Datasource succeeded.

Remarks:

  • Remember that this solution above impacts all Oracle JDBC datasources on the Managed Server
  • Oracle does not(!) support the use of ojdbc14.jar in an environment with Java version 6 or later.
  • However ojdbc14 should work just fine, certainly for us as a work-around. The primary differences between 1.4 and newer versions as 6 is that newer versions support new features of the JDBC API and Oracle Database.

References:

Advertisements
 
Leave a comment

Posted by on 26-07-2011 in Oracle, Weblogic

 

Tags: ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: