DB2 Security exceptions with Java 8

16,516 views
Skip to first unread message

David Le Borgne

unread,
Jan 21, 2015, 5:53:34 AM1/21/15
to sql-wo...@googlegroups.com
I am using SQL Workbench/J build 117 (2015-01-24 21:00) and just upgraded to Java 8 (1.8.0_31)
Since this upgrade, I am not able to connect to DB2 databases using the IBM DB2 10.5.0 JDBC4 driver.
The error message is the following :

Origination unknown: [10228][11541][4.16.53] Security exceptions occurred while loading driver. ERRORCODE=4223, SQLSTATE=null

If I revert to Java 7, the error does not occur.

David Le Borgne

unread,
Jan 21, 2015, 6:32:45 AM1/21/15
to sql-wo...@googlegroups.com
Workarounded the problem by creating a SQLWorkbench64.ini file in the SQLWorkbench64.exe directory. This file contains :

vm.version.max=1.7
vm.location=C:\Path\to\jdk7\bin\server\jvm.dll



Thomas Kellerer

unread,
Jan 21, 2015, 7:50:27 AM1/21/15
to sql-wo...@googlegroups.com
What is the complete Stacktrace for this error?

I can connect against a DB2 10.1 LUW using Java8 (1.8.0_25) using the 10.5 driver (version: 4.16.53) without problems

There are some indications that this might be caused by the authentication method:

http://www.dbvis.com/forum/thread.jspa?messageID=12305&#12305
http://sourceforge.net/p/squirrel-sql/bugs/998/

Maybe some encrypting algorithms have been changed between Java7 and Java8, but I don't know

Regards
Thomas

ryan.magnusson

unread,
Jan 22, 2015, 2:29:11 PM1/22/15
to sql-wo...@googlegroups.com
I have been having the same problem trying to connect against a DB2 on zOS using Java 1.8.0_25 and the 10.5 driver (version: 4.17.29).

On IBM's website I discovered that two more releases of the driver have been released since then: 4.18.60 (fix pack 4) and 4.19.26 (fix pack 5).

The fix pack 4 version gave the same error; however, I was successful using the newest driver from fix pack 5.

Hope this helps.
Ryan

Alexandros Collie

unread,
Feb 22, 2016, 3:46:37 PM2/22/16
to SQL Workbench/J - DBMS independent SQL tool
I am having the same problem: Here are my specifications:
  • Operating System: Windows 7
  • Java JDK: Oracle Java 1.8.0_74
  • Java JRE: Oracle Java 1.8.0_74
  • SQL Workbench/J: 119
  • com.ibm.db2.jcc.DB2Jcc: 3.66.46
  • DB2: 9.7
Also, I receive this error when I try to view trigger source. I am to access the database but not triggers.

Thomas Kellerer

unread,
Feb 22, 2016, 4:01:04 PM2/22/16
to sql-wo...@googlegroups.com
SQL Workbench/J is simply running

SELECT text
FROM syscat.triggers

to get the source of the trigger.

If there is a security exception I'm pretty sure this is not related to the Java upgrade.

Can you rund the above statement manually? If yes what happens?

Thomas


Alexandros Collie schrieb am 22.02.2016 um 21:46:
> I am having the same problem: Here are my specifications:
>
> * Operating System: Windows 7
> * Java JDK: Oracle Java 1.8.0_74
> * Java JRE: Oracle Java 1.8.0_74
> * SQL Workbench/J: 119
> * com.ibm.db2.jcc.DB2Jcc: 3.66.46
> * DB2: 9.7

Alexandros Collie

unread,
Feb 22, 2016, 4:19:14 PM2/22/16
to SQL Workbench/J - DBMS independent SQL tool
Thanks, yes it works.

However the ui has a context menu entry that allows you to see the code of triggers.  But rather than displaying the trigger source it display the before mentioned errors that is also displayed on connecting while opening SQL Workbench/J.

As per the command, it displays the source of all the triggers on the database.

Btw, other database managers do get this connection error and the source of the trigger are accessible via the context menus. I am interested in knowing why I am getting this error under SQL Workbench/J.

Thanks

Thomas Kellerer

unread,
Feb 22, 2016, 4:33:01 PM2/22/16
to sql-wo...@googlegroups.com
Are you saying that you can run

SELECT text
FROM syscat.triggers
where trigname = ...
and trigschema = ...

manually, but you get an error when displaying the source in the DbExplorer?

If that is indeed the case, then please send me the complete logfile.

Does the DbExplorer behave differently then the DbTree?

Thomas
> --
> You received this message because you are subscribed to the Google Groups "SQL Workbench/J - DBMS independent SQL tool" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sql-workbenc...@googlegroups.com <mailto:sql-workbenc...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

Thomas Kellerer

unread,
Feb 22, 2016, 4:38:28 PM2/22/16
to sql-wo...@googlegroups.com
Also: did you try to upgrade to a Java 8 compatible driver?

They have version numbers 4.xxx.yyy and they use "com.ibm.db2.jcc.DB2Driver" as the driver class, not "com.ibm.db2.jcc.DB2Jcc"

Thomas


Alexandros Collie schrieb am 22.02.2016 um 21:46:
> I am having the same problem: Here are my specifications:
>
> * Operating System: Windows 7
> * Java JDK: Oracle Java 1.8.0_74
> * Java JRE: Oracle Java 1.8.0_74
> * SQL Workbench/J: 119
> * com.ibm.db2.jcc.DB2Jcc: 3.66.46
> * DB2: 9.7

Alexandros Collie

unread,
Feb 22, 2016, 4:52:04 PM2/22/16
to SQL Workbench/J - DBMS independent SQL tool
Yes I can.
> To unsubscribe from this group and stop receiving emails from it, send an email to sql-workbenc...@googlegroups.com <mailto:sql-workbench+unsub...@googlegroups.com>.

Alexandros Collie

unread,
Feb 22, 2016, 6:15:48 PM2/22/16
to SQL Workbench/J - DBMS independent SQL tool
I don't understand could you please clafify?

I can tell you that I have the lastest java and 3.x driver.

I will try it tomorrow and let you know the results.

Thomas Kellerer

unread,
Feb 23, 2016, 1:54:06 AM2/23/16
to sql-wo...@googlegroups.com
> I don't understand could you please clarify?

Drivers for JDBC 3.0 (Java 6 & 7) are numbered 3.x
Drivers for JDBC 4.0 (Java 8) are numbered 4.x

With Java 8 you should use a JDBC 4.0 driver:

http://www-01.ibm.com/support/docview.wss?uid=swg21363866

Thomas
> --
> You received this message because you are subscribed to the Google Groups "SQL Workbench/J - DBMS independent SQL tool" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sql-workbenc...@googlegroups.com <mailto:sql-workbenc...@googlegroups.com>.

Alexandros Collie

unread,
Feb 24, 2016, 9:37:02 AM2/24/16
to SQL Workbench/J - DBMS independent SQL tool
I am still getting the same error even after switching to db2jcc4.jar version 4.16.53


Origination unknown: [10228][11541][4.16.53] Security exceptions occurred while loading driver. ERRORCODE=4223, SQLSTATE=null

I think the problem is with SQL Workbench/J because I not having this problem using DBeaver or SQurreL SQL client.
> To unsubscribe from this group and stop receiving emails from it, send an email to sql-workbenc...@googlegroups.com <mailto:sql-workbench+unsub...@googlegroups.com>.

Thomas Kellerer

unread,
Feb 24, 2016, 9:45:56 AM2/24/16
to sql-wo...@googlegroups.com
I get the same warning with 4.16.53, but not with 4.19.26

(against a DB2 Express-C 10.1 on SUSE Linux)

Thomas

Alexandros Collie schrieb am 24.02.2016 um 15:37:
> I am still getting the same error even after switching to db2jcc4.jar version 4.16.53
>
> Origination unknown: [10228][11541][4.16.53] Security exceptions occurred while loading driver. ERRORCODE=4223, SQLSTATE=null
>
> I think the problem is with SQL Workbench/J because I not having this problem using DBeaver or SQurreL SQL client.
>
> On Tuesday, February 23, 2016 at 1:54:06 AM UTC-5, Thomas Kellerer wrote:
>
> > I don't understand could you please clarify?
>
> Drivers for JDBC 3.0 (Java 6 & 7) are numbered 3.x
> Drivers for JDBC 4.0 (Java 8) are numbered 4.x
>
> With Java 8 you should use a JDBC 4.0 driver:
>
> http://www-01.ibm.com/support/docview.wss?uid=swg21363866 <http://www-01.ibm.com/support/docview.wss?uid=swg21363866>
>
> Thomas
>
> > I can tell you that I have the lastest java and 3.x driver.
> >
> > I will try it tomorrow and let you know the results.
> >
> > On Monday, February 22, 2016 at 4:38:28 PM UTC-5, Thomas Kellerer wrote:
> >
> > Also: did you try to upgrade to a Java 8 compatible driver?
> >
> > They have version numbers 4.xxx.yyy and they use "com.ibm.db2.jcc.DB2Driver" as the driver class, not "com.ibm.db2.jcc.DB2Jcc"
> >
> > Thomas
> >
> >
> > Alexandros Collie schrieb am 22.02.2016 um 21:46:
> > > I am having the same problem: Here are my specifications:
> > >
> > > * Operating System: Windows 7
> > > * Java JDK: Oracle Java 1.8.0_74
> > > * Java JRE: Oracle Java 1.8.0_74
> > > * SQL Workbench/J: 119
> > > * com.ibm.db2.jcc.DB2Jcc: 3.66.46
> > > * DB2: 9.7
> > >
> > > Also, I receive this error when I try to view trigger source. I am to access the database but not triggers.
> > >
> > > On Wednesday, 21 January 2015 05:53:34 UTC-5, David Le Borgne wrote:
> > >
> > > I am using SQL Workbench/J build 117 (2015-01-24 21:00) and just upgraded to Java 8 (1.8.0_31)
> > > Since this upgrade, I am not able to connect to DB2 databases using the IBM DB2 10.5.0 JDBC4 driver.
> > > The error message is the following :
> > >
> > > Origination unknown: [10228][11541][4.16.53] Security exceptions occurred while loading driver. ERRORCODE=4223, SQLSTATE=null
> > >
> > > If I revert to Java 7, the error does not occur.
> >
> > --
> > You received this message because you are subscribed to the Google Groups "SQL Workbench/J - DBMS independent SQL tool" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to sql-workbenc...@googlegroups.com <javascript:> <mailto:sql-workbenc...@googlegroups.com <javascript:>>.
> > For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google Groups "SQL Workbench/J - DBMS independent SQL tool" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sql-workbenc...@googlegroups.com <mailto:sql-workbenc...@googlegroups.com>.

Thomas Kellerer

unread,
Feb 24, 2016, 9:50:21 AM2/24/16
to sql-wo...@googlegroups.com
> However the ui has a context menu entry that allows you to see the code of triggers.
> But rather than displaying the trigger source it display the before mentioned errors

This is indeed an oversight in the DbTree. It always uses a separate connection, but the warnings for that connection are not cleared after establishing the connection. I will fix that.

This does not happen when you look at the trigger source in the DbExplorer (rather then the DbTree).

Thomas

Alexandros Collie

unread,
Feb 24, 2016, 10:32:18 AM2/24/16
to SQL Workbench/J - DBMS independent SQL tool
You are that it goes away but I am still unable to access trigger source from the right context menu Show source and Edit in. It that they were separate issues.

Thanks for all your assistance.
>     > To unsubscribe from this group and stop receiving emails from it, send an email to sql-workbenc...@googlegroups.com <javascript:> <mailto:sql-workbench+unsub...@googlegroups.com <javascript:>>.
>     > For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.
>
> --
> You received this message because you are subscribed to the Google Groups "SQL Workbench/J - DBMS independent SQL tool" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sql-workbenc...@googlegroups.com <mailto:sql-workbench+unsub...@googlegroups.com>.

Thomas Kellerer

unread,
Feb 24, 2016, 10:34:05 AM2/24/16
to sql-wo...@googlegroups.com
> but I am still unable to access trigger source from the right context menu Show source and Edit in.

You can't edit the trigger source when you use "Show source".
You can only edit it in the DbExplorer or when you choose "Edit In" from the DbTree, then you can edit the source in the Editor tab.


Thomas

Alexandros Collie

unread,
Feb 24, 2016, 10:42:39 AM2/24/16
to SQL Workbench/J - DBMS independent SQL tool
Thanks, I figured that out earlier today.

By the way, the warning also goes away with version 3.69.49.

Once again, many thanks for all your patience and assistance.

rahul muraly

unread,
Mar 20, 2017, 10:39:37 AM3/20/17
to SQL Workbench/J - DBMS independent SQL tool

Hi,

Warning does goes away with version 3.69.49.
But the error still present in the workbench log.
Error I got copied below. Just wanted to know whether there will be open connections in DB causing increase in load. 

2017-03-20 20:05:08 WARN  Error when closing connection [jcc][t4][10251][10308][3.69.49] java.sql.Connection.close() requested while a transaction is in progress on the connection.
The transaction remains active, and the connection cannot be closed. ERRORCODE=-4471, SQLSTATE=null [DB Errorcode=-4471] 
com.ibm.db2.jcc.am.SqlException: [jcc][t4][10251][10308][3.69.49] java.sql.Connection.close() requested while a transaction is in progress on the connection.
The transaction remains active, and the connection cannot be closed. ERRORCODE=-4471, SQLSTATE=null
at com.ibm.db2.jcc.am.gd.a(Unknown Source)
at com.ibm.db2.jcc.am.gd.a(Unknown Source)
at com.ibm.db2.jcc.am.gd.a(Unknown Source)
at com.ibm.db2.jcc.am.Connection.checkForTransactionInProgress(Unknown Source)
at com.ibm.db2.jcc.t4.b.checkForTransactionInProgress(Unknown Source)
at com.ibm.db2.jcc.am.Connection.closeResourcesX(Unknown Source)
at com.ibm.db2.jcc.am.Connection.closeX(Unknown Source)
at com.ibm.db2.jcc.am.Connection.close(Unknown Source)
at workbench.db.WbConnection.shutdown(WbConnection.java:989)
at workbench.db.WbConnection.shutdown(WbConnection.java:930)
at workbench.db.ConnectionMgr.closeConnection(ConnectionMgr.java:651)
at workbench.db.ConnectionMgr.disconnect(ConnectionMgr.java:617)
at workbench.db.WbConnection.disconnect(WbConnection.java:905)
at workbench.gui.MainWindow.doDisconnect(MainWindow.java:2322)
at workbench.gui.MainWindow.lambda$disconnect$16(MainWindow.java:2264)
at java.lang.Thread.run(Unknown Source)

Thomas Kellerer

unread,
Mar 21, 2017, 4:21:17 AM3/21/17
to sql-wo...@googlegroups.com
> Error I got copied below. Just wanted to know whether there will be open connections in DB causing increase in load.

I don't think so.

If you want to prevent that warning message, you can enable "Rollback before disconnect" in the connection profile.

Thomas
> --
> You received this message because you are subscribed to the Google Groups "SQL Workbench/J - DBMS independent SQL tool" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sql-workbenc...@googlegroups.com <mailto:sql-workbenc...@googlegroups.com>.

Satish Sirohi

unread,
Oct 10, 2019, 6:13:15 AM10/10/19
to SQL Workbench/J - DBMS independent SQL tool
Hi Ryan,

I too had been facing the same issue i.e. DB2 connection was successful, however no Schema got loaded, I then enabled tracing and finally landed on this page. Your comments led me to the IBM site to download the latest jar compatible with Java 1.8, got v11.1.4fp4a_jdc and this made the schema and associated DB objects loaded in my IDE in local. :)

Thanks a lot!

Satish Sirohi
Reply all
Reply to author
Forward
0 new messages