A query to an Oracle data source fails with "An internal error has occurred. Cause: oracle/jdbc/OracleConnection" in TIBCO Data Virtualization

A query to an Oracle data source fails with "An internal error has occurred. Cause: oracle/jdbc/OracleConnection" in TIBCO Data Virtualization

book

Article ID: KB0074590

calendar_today

Updated On:

Products Versions
TIBCO Data Virtualization 8.2.x and higher

Description

A query to an Oracle data source fails with "An internal error has occurred. Cause: oracle/jdbc/OracleConnection".

The cs_server.log contains the following trace:

----------------
ERROR [jetty thread pool-27204] 2020-10-17 21:55:02.833 -0400 Util - User Exception Occurred
com.compositesw.common.UserException: An internal error has occurred.
Cause: oracle/jdbc/OracleConnection [Log ID: 56a61721-fe6c-49ac-9931-db9c0c63d9e2] 
    at com.compositesw.common.UserException$Builder.build(UserException.java:162)
    at com.compositesw.cdms.webapi.service.Util.createWebapiException(Util.java:97)
...
Caused by: java.lang.NoClassDefFoundError: oracle/jdbc/OracleConnection
    at com.compositesw.cdms.ds.oracle.OracleConnection.createSqlConnection(OracleConnection.java:929)
    at com.compositesw.cdms.ds.jdbc.JdbcConnectionImpl.init(JdbcConnectionImpl.java:156)
    at com.compositesw.cdms.datasource.AbstractDataSource.getDataSourceConnection(AbstractDataSource.java:796)
----------------

Issue/Introduction

A query to an Oracle data source fails with "An internal error has occurred. Cause: oracle/jdbc/OracleConnection"

Resolution

There are three possible causes for this error.

(1)    Compatibility

The Oracle driver jar (e.g. ojdbc10.jar) is not compatible with JDK 11. TDV 8.2 and higher use JDK 11. Therefore, the Oracle driver jar needs to be compatible with this Java version. The Oracle site has a compatibility matrix page ( What are the Oracle JDBC releases Vs JDK versions?) that provides details on what JDK versions are supported by each Oracle driver jar.

(2)   Missing class file

The Oracle driver jar file does not contain the file oracle.jdbc.OracleConnection.class. You can check  whether this is the issue by opening the jar in 7-Zip or Winzip and looking for the file under the \oracle\jdbc folder as shown below:
 
User-added image

Alternatively, you can use the <TDV_INSTALL>\jdk\bin\jar utility to search the jar as in the example below:

On Windows:

C:\apps\tdv83\jdk\bin\jar -tvf ojdbc10.jar | findstr /C:"OracleConnection.class"
 ===> 46627 Mon Sep 30 11:57:32 PDT 2019 oracle/jdbc/OracleConnection.class"

User-added image

On Linux:

\opt\TIBCO\tdv83\jdk\bin\jar -tvf | grep "OracleConnection.class"
===> 46627 Mon Sep 30 11:57:32 PDT 2019 oracle/jdbc/OracleConnection.class"

(3)  Additional jars are required

The Oracle driver jar needs to be accompanied by additional jars that provide the driver with support for handling data types. Typically, these jars are xdb.jar and xmlparserv2.jar. 

(i)  Download the jars from the Oracle site.
(ii) Copy them to the relevant TDV folder. For instance, if this is an Oracle 12c Thin data source, copy the jars to the <TDV_INSTALL>\conf\adapters\system\oracle_12c_thin_driver folder.
(iii) Restart the  TDV server.

 

Additional Information

Details on the supporting jar files needed by the Oracle JDBC driver
Oracle Database 19c (19.6) JDBC Driver Download page