cancel
Showing results for 
Search instead for 
Did you mean: 

Sybase and Oracle JDBC Drivers cause errors when loading drivers running in OpenJDK 11

pmarzullo59
Discoverer
0 Kudos

When having Sybase (from jconn4.jar) and Oracle (from ojdbc8.jar) in the classpath, where jconn4.jar shows up before the ojdbc8.jar in the classpath, the initialization (registration) of the jdbc drivers fail, but when ojdbc8.jar shows up before jconn4.jar, it works fine.

Test harness attached (TestDriverLoad.java, attached as TestDriverLoad.txt)testdriverload.txt

Jar files in subdirectory jars (commons-dbcp-1.4.jar, commons-pool-1.5.4.jar, jconn4.jar, ojdbc8.jar).

JVM Version:

openjdk version "11.0.2" 2019-01-15

OpenJDK Runtime Environment 18.9 (build 11.0.2+9)

OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)

To compile:

javac -cp jars/commons-dbcp-1.4.jar:jars/commons-pool-1.5.4.jar TestDriverLoad.java

To run (unsuccessfully):

java -cp .:jars/jconn4.jar:jars/ojdbc8.jar:jars/commons-dbcp-1.4.jar:jars/commons-pool-1.5.4.jar TestDriverLoad createBasicDataSource

To run (successfully) (notice the order of the jars in the classpath):

java -cp .:jars/ojdbc8.jar:jars/jconn4.jar:jars/commons-dbcp-1.4.jar:jars/commons-pool-1.5.4.jar TestDriverLoad createBasicDataSource

Error output attached (errors.txt)errors.txt

What are my options other than ordering the jars in the classpath ?

Accepted Solutions (0)

Answers (3)

Answers (3)

ryan_hansen
Employee
Employee
0 Kudos

Hi,

KBA# 2827462

https://launchpad.support.sap.com/#/notes/2827462

  • There is currently no target SAP SDK Service Pack scheduled for this issue (SAP CR 819869). It is being assigned to our Product Group. Please mark this KBA as a Favorite to be automatically notified when the CR status has changed.
  • Work Around:
  1. Do not use wildcard in classpath
  2. Remove oracle driver when not needed
  3. Load Oracle driver in classpath specifically first

Regards,
Ryan

pravinkumar23
Member
0 Kudos

I am facing this exact issue, i am using the latest odbc11 jar and the latest version of jconn jar, please say work round for this issue

ryan_hansen
Employee
Employee
0 Kudos

Hi,

I would check the versions of drivers you are using.
See a few items where older versions cause issues:
https://stackoverflow.com/questions/53790147/java-lang-noclassdeffounderror-could-not-initialize-cla...

https://stackoverflow.com/questions/50727309/oracle-jdbc-driver-with-java-9-java-lang-noclassdeffoun...

SAP driver version:
java -jar jconn4.jar

Regards,
Ryan

pmarzullo59
Discoverer
0 Kudos

Oracle driver (the latest that I could find):

java -jar ojdbc8.jar

Oracle 18.3.0.0.0 JDBC 4.2 compiled with javac 1.8.0_171 on Tue_Jun_26_11:06:40_PDT_2018

#Default Connection Properties Resource

#Mon Mar 11 09:12:54 EDT 2019

***** JCE UNLIMITED STRENGTH IS INSTALLED ****

Sybase driver (also the latest that I could find from latest SDK):

java -jar jconn4.jar

jConnect (TM) for JDBC(TM)/16.0 SP02 PL07 (Build 27363)/P/EBF27657/JDK 1.6.0/jdbcmain/OPT/Tue Sep 26 18:50:13 PDT 2017

Confidential property of SAP AG or an SAP affiliate company.

Copyright (c) 2013

SAP AG or an SAP affiliate company.All rights reserved.

Unpublished rights reserved under U.S. copyright laws.

This software contains confidential and trade secret information of SAP AG or

an SAP affiliate company. Use, duplication or disclosure of the software and

documentation by theU.S.Governmentissubjecttorestrictions set forth in

a license agreementbetweentheGovernmentand SAP AG or an SAP affiliate

company,orotherwritten agreementspecifyingtheGovernment's rights to

use the software and any applicable FAR provisions, for example, FAR 52.227-19.

SAP AG or an SAP affiliate company