DB connector Execute failed: ("SQLException"): -1

Hi all,

when trying to connect to our oracle DB in Knime 4.1, we receive the error Execute failed: (“SQLException”): -1. The same error occurs for all DB connectors (DB connector, legacy, oracle connector).
The error does not occur using Knime Version 3.7
The driver is configured in Knime preferences.

Log:
2020-04-17 12:14:24,514 : ERROR : KNIME-Worker-6-DB Connector 0:358 : : Node : DB Connector : 0:358 : Execute failed: (“SQLException”): -1
java.sql.SQLException: -1
at org.knime.database.util.Futures.throwDatabaseExecutionException(Futures.java:112)
at org.knime.database.connection.impl.DBConnectionManager.initializeConnection(DBConnectionManager.java:473)
at org.knime.database.connection.impl.DBConnectionManager.(DBConnectionManager.java:254)
at org.knime.database.session.impl.DefaultDBSession.(DefaultDBSession.java:212)
at org.knime.database.session.impl.DBSessionFactory.create(DBSessionFactory.java:81)
at org.knime.database.session.DBSessionCache.getOrCreate(DBSessionCache.java:151)
at org.knime.database.node.connector.AbstractDBConnectorNodeModel.registerSession(AbstractDBConnectorNodeModel.java:388)
at org.knime.database.node.connector.AbstractDBConnectorNodeModel.execute(AbstractDBConnectorNodeModel.java:219)
at org.knime.core.node.NodeModel.executeModel(NodeModel.java:571)
at org.knime.core.node.Node.invokeFullyNodeModelExecute(Node.java:1236)
at org.knime.core.node.Node.execute(Node.java:1016)
at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(NativeNodeContainer.java:557)
at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(LocalNodeExecutionJob.java:95)
at org.knime.core.node.workflow.NodeExecutionJob.internalRun(NodeExecutionJob.java:218)
at org.knime.core.node.workflow.NodeExecutionJob.run(NodeExecutionJob.java:124)
at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(ThreadUtils.java:334)
at org.knime.core.util.ThreadUtils$RunnableWithContext.run(ThreadUtils.java:210)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.knime.core.util.ThreadPool$MyFuture.run(ThreadPool.java:123)
at org.knime.core.util.ThreadPool$Worker.run(ThreadPool.java:246)
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
at oracle.jdbc.driver.T4CTTIoauthenticate.setSessionFields(T4CTTIoauthenticate.java:1505)
at oracle.jdbc.driver.T4CTTIoauthenticate.(T4CTTIoauthenticate.java:294)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:675)
at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:793)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:57)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:747)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:562)
at org.knime.database.connection.UrlDBConnectionController$ControlledDriver.connect(UrlDBConnectionController.java:95)
at org.knime.database.connection.UrlDBConnectionController.createConnection(UrlDBConnectionController.java:308)
at org.knime.database.connection.UserDBConnectionController.createConnection(UserDBConnectionController.java:249)
at org.knime.database.connection.AbstractConnectionProvider.createConnection(AbstractConnectionProvider.java:89)
at org.knime.database.connection.impl.DBConnectionManager.lambda$2(DBConnectionManager.java:458)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

Did anyone face similar problems and managed to solve it?

Thank you and best regards,
Amely

1 Like

Hello Amely,
the error indicates a problem within the JDBC driver during authentication:

Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
at oracle.jdbc.driver.T4CTTIoauthenticate.setSessionFields(T4CTTIoauthenticate.java:1505)

What Oracle driver version and file do you use? It should be the ojdbc8.jar file which is the right one for Java 8 which KNIME Analytics Platform runs with. Also do you use any special JDBC parameter?
Thanks
Tobias

1 Like

Hi Tobias,

we use the ojdbc8.jar file and already tried driver version 12.x and 19.x.
We don’t use any special JDBC parameters.
The strange thing is, that the same settings work in Knime 3.7.

Best regards,
Amely

1 Like

Hi Amely,
do you use the same driver file in KNIME 3.7 and KNIME 4.1? Maybe you need to register additional jars to connect to your Oracle database e.g. when using Oracle Wallet?
If this is the case you can unzip the driver jar and all of its companion libs into a directory and then register the complete folder via the Add directory button as shown here


You can also add the jars separately via the Add file button like this:

Bye
Tobias

2 Likes

Hi Tobias,

I use exactly the same driver file in KNIME 3.7.
I tried to register the additional jars, but still get the same error message.
I also tried to reset all settings and configure the driver again.
Connecting to other DBs in KNIME 4.0 works fine (teradata).

Oracle DB version information:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
PL/SQL Release 12.1.0.2.0 - Production
“CORE 12.1.0.2.0 Production”
TNS for Linux: Version 12.1.0.2.0 - Production
NLSRTL Version 12.1.0.2.0 - Production

KNIME settings:

Best regards,
Amely

1 Like

Hi Amely,
can you please move the ojdbc8.jar file from the lib\ext folder into another folder outside of the jre folder of your KNIME installation. Maybe create a new folder in the <KNIME_INSTALLATION_ROOT> such as jdbc or dbdriver and place it in there and then change the file path in the driver settings to the new location.
The lib\ext folder should contain classes that are loaded automatically by the Java runtime that KNIME Analytics Platform is running on and might cause problems with the database framework.
Bye
Tobias

3 Likes

Hi Tobias,

thank you for the hint. At first I was a bit confused, because I got an error for the other database I am using (teradata) when changing the directory of the jars.
It seems like the teradata jars need to be in the lib/ext directory while the oracle jar must not be in this directory.
Anyway, I’m happy it’s working again.

Thank you for your support!
Amely

1 Like

Hi Amely,
I’m glad it works now. However I wonder why the the Teradata driver doesn’t work outside of the lib/ext directory. If you want to I can help you with this as well. Just send me the error message that you get when registering it in another folder then the lib/ext one.
Thanks
Tobias

Hi Tobias,

I just found out, that it works with the jars in another directory with the new DB nodes.
grafik

However, I am still using the legacy nodes regularly and getting an error when using them with the jars in another directory:
grafik

2020-04-21 17:37:17,568 : ERROR : KNIME-Worker-1-Database Connector (legacy) 0:5 : : Node : Database Connector (legacy) : 0:5 : Execute failed: Could not create connection to database: null
java.sql.SQLException: Could not create connection to database: null
at org.knime.base.node.io.database.connection.JDBCConnectorNodeModel.execute(JDBCConnectorNodeModel.java:122)
at org.knime.core.node.NodeModel.executeModel(NodeModel.java:571)
at org.knime.core.node.Node.invokeFullyNodeModelExecute(Node.java:1236)
at org.knime.core.node.Node.execute(Node.java:1016)
at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(NativeNodeContainer.java:557)
at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(LocalNodeExecutionJob.java:95)
at org.knime.core.node.workflow.NodeExecutionJob.internalRun(NodeExecutionJob.java:218)
at org.knime.core.node.workflow.NodeExecutionJob.run(NodeExecutionJob.java:124)
at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(ThreadUtils.java:334)
at org.knime.core.util.ThreadUtils$RunnableWithContext.run(ThreadUtils.java:210)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.knime.core.util.ThreadPool$MyFuture.run(ThreadPool.java:123)
at org.knime.core.util.ThreadPool$Worker.run(ThreadPool.java:246)
Caused by: java.sql.SQLException: java.lang.ExceptionInInitializerError
at org.knime.core.node.port.database.connection.CachedConnectionFactory.getConnection(CachedConnectionFactory.java:239)
at org.knime.core.node.port.database.DatabaseConnectionSettings.createConnection(DatabaseConnectionSettings.java:474)
at org.knime.core.node.port.database.DatabaseConnectionSettings.execute(DatabaseConnectionSettings.java:667)
at org.knime.base.node.io.database.connection.JDBCConnectorNodeModel.execute(JDBCConnectorNodeModel.java:113)
… 13 more
Caused by: java.lang.ExceptionInInitializerError
at com.teradata.jdbc.jdbc.GenericTeraEncrypt.getGSSM(GenericTeraEncrypt.java:577)
at com.teradata.jdbc.jdbc.GenericTeraEncrypt.(GenericTeraEncrypt.java:116)
at com.teradata.jdbc.jdbc.GenericTeradataConnection.(GenericTeradataConnection.java:107)
at com.teradata.jdbc.jdbc_4.TDSession.(TDSession.java:187)
at com.teradata.jdbc.jdk6.JDK6_SQL_Connection.(JDK6_SQL_Connection.java:36)
at com.teradata.jdbc.jdk6.JDK6ConnectionFactory.constructSQLConnection(JDK6ConnectionFactory.java:25)
at com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:178)
at com.teradata.jdbc.jdbc.ConnectionFactory.createConnection(ConnectionFactory.java:168)
at com.teradata.jdbc.TeraDriver.doConnect(TeraDriver.java:236)
at com.teradata.jdbc.TeraDriver.connect(TeraDriver.java:162)
at org.knime.core.node.port.database.DatabaseWrappedDriver.connect(DatabaseWrappedDriver.java:81)
at org.knime.core.node.port.database.connection.CachedConnectionFactory.createConnection(CachedConnectionFactory.java:351)
at org.knime.core.node.port.database.connection.CachedConnectionFactory.createConnection(CachedConnectionFactory.java:332)
at org.knime.core.node.port.database.connection.CachedConnectionFactory$1.call(CachedConnectionFactory.java:223)
at org.knime.core.node.port.database.connection.CachedConnectionFactory$1.call(CachedConnectionFactory.java:1)
at org.knime.core.util.ThreadUtils$CallableWithContextImpl.callWithContext(ThreadUtils.java:350)
at org.knime.core.util.ThreadUtils$CallableWithContext.call(ThreadUtils.java:250)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
at com.teradata.tdgss.jtdgss.TdgssConfigApi.GetMechanisms(Unknown Source)
at com.teradata.tdgss.jtdgss.TdgssManager.(Unknown Source)
at com.teradata.tdgss.jtdgss.TdgssManager.(Unknown Source)
… 21 more

Best regards,
Amely

2 Likes

Hi Amely,
with the old database framework you have to move the two Teradata jars into a single directory e.g. *C:\TEMP\driver\teradata* and then use the Add directory button to register the newly created directory with the two files inside instead of registering the two files using the Add file button. Then it should work.
Bye
Tobias

2 Likes

Hi Tobias,
it works with the add directory option. I think that I tried it at some point of testing, but maybe there were other issues then.
However quite interesting that it also works with the single jars in this specific folder.
Thank you again for the support! :slight_smile:
Amely

2 Likes

Hi Amely,
perfect. I will close the thread. The lib/ext folder is a special folder for extensions in the Java Virtual Machine that KNIME Analytics Platform uses. For the database framework we use another way to make it extendable which is why it caused problems. Thanks for your patience and take care.
Bye
Tobias