I loaded with loadjava tool Jaybird-3.0.9-JDK_1.8 JDBC driver and my java class to Oracle database. All classes were resolved. When I run Java Stored Procedure from Oracle first time got

error ORA-29532: Java call terminated by uncaught Java exception: java.util.ServiceConfigurationError: org.firebirdsql.gds.impl.GDSFactoryPlugin: Error reading configuration file

when the java application was creating connection.

The next calls with the same Oracle connection lead to

ORA-29532: Java call terminated by uncaught Java exception: java.lang.NoClassDefFoundError

After reconnect I get ServiceConfigurationError exception again. The same code works fine from java. Any good idea? Many thanks

1

There are 1 answers

8
Mark Rotteveel On

Jaybird loads some of its components as plugins through java.util.ServiceLoader, and if that doesn't work, it will fallback to a fixed list of plugins. Unfortunately, in this case a ServiceConfigurationError was thrown where Jaybird didn't expect it, and thus this error wasn't handled and as a result, the loading of the class GDSFactory was terminated (which causes the subsequent NoClassDefFoundError).

Based on your question, I don't know exactly what this failure is, but at a guess either loadjava or the Oracle classloader seems to have corrupted the service definition file (META-INF/services/org.firebirdsql.gds.impl.GDSFactoryPlugin), or otherwise causes an exception when it is read.

I have created bug JDBC-636, to handle this exception in Jaybird 3.0.10, 4.0.2, and in the upcoming Jaybird 5.

Jaybird 3.0.10 and 4.0.2 have been released, so use those versions instead of the snapshots below.

As long as Jaybird 3.0.10 and 4.0.2 have not been released, you can try the 3.0.10-SNAPSHOT or 4.0.2.java8-SNAPSHOT from the Sonatype snapshot repository (https://oss.sonatype.org/content/repositories/snapshots) using Maven or Gradle. Or you can download the jar directly from the snapshot repository (NOTE: these links will break when newer snapshots have been deployed):