IBM Support

Java UDF returns error -4306 and message JNI GetMethodID failed with DB2 11.5.8.0

Troubleshooting


Problem

After the upgrade of DB2 Server to the version 11.5.8.0, a Java UDF returns SQL Error -4306 and in db2diag.log we have the message:
2023-06-12-10.25.38.332401+180 I982698A1031         LEVEL: Warning
PID     : 21758474             TID : 4885           PROC : db2fmp (Java) 0
INSTANCE: db2inst1             NODE : 000           DB   : MYDB
APPID   : 192.168.1.1.54828.230612073853
HOSTNAME: myhost
EDUID   : 4885                 EDUNAME: db2fmp (Java) 0
FUNCTION: DB2 UDB, BSU Java support, sqlejCallJavaRoutine_dll, probe:130
MESSAGE : JNI GetMethodID failed.  class:
DATA #1 : Hexdump, 107 bytes

 

Symptom

Check db2diag.log in messages look like:
2023-06-12-10.25.38.332401+180 I982698A1031         LEVEL: Warning
PID     : 21758474             TID : 4885           PROC : db2fmp (Java) 0
INSTANCE: db2inst1             NODE : 000           DB   : MYDB
APPID   : 192.168.1.1.54828.230612073853
HOSTNAME: myhost
EDUID   : 4885                 EDUNAME: db2fmp (Java) 0
FUNCTION: DB2 UDB, BSU Java support, sqlejCallJavaRoutine_dll, probe:130
MESSAGE : JNI GetMethodID failed.  class:
DATA #1 : Hexdump, 107 bytes
0x0000000122054CA0 : 2F64 6232 686F 6D65 2F64 6232 6430 3031    /db2home/db2d001
0x0000000122054CB0 : 2F73 716C 6C69 622F 6675 6E63 7469 6F6E    /sqllib/function
....
2023-06-12-10.25.38.335553+180 I983730A540          LEVEL: Warning
PID     : 21758474             TID : 4885           PROC : db2fmp (Java) 0
INSTANCE: db2inst1             NODE : 000           DB   : MYDB
APPID   : 192.168.1.1.54828.230612073853
HOSTNAME: myhost
EDUID   : 4885                 EDUNAME: db2fmp (Java) 0
FUNCTION: DB2 UDB, BSU Java support, sqlejCallJavaRoutine_dll, probe:140
MESSAGE : JNI GetMethodID failed.  method:
DATA #1 : Hexdump, 7 bytes
0x0000000122054D0C : 6465 6372 7970 74                          decrypt

2023-06-12-10.25.38.350941+180 E985593A2132         LEVEL: Warning
PID     : 21758474             TID : 4885           PROC : db2fmp (Java) 0
INSTANCE: db2inst1             NODE : 000           DB   : MYDB
APPID   : 192.168.1.1.54828.230612073853
HOSTNAME: myhost
EDUID   : 4885                 EDUNAME: db2fmp (Java) 0
FUNCTION: DB2 UDB, BSU Java support, sqlejLogExceptionToDiag, probe:1642
DATA #1 : String, 1705 bytes
java.lang.ExceptionInInitializerError
        at java.lang.J9VMInternals.ensureError(J9VMInternals.java:145)
        at java.lang.J9VMInternals.recordInitializationFailure(J9VMInternals.java:134)
Caused by: java.security.ProviderException: Failed to initialize IBMJCEPlus provider
        at com.ibm.crypto.plus.provider.IBMJCEPlus.a(IBMJCEPlus.java:272)
        at com.ibm.crypto.plus.provider.IBMJCEPlus.e(IBMJCEPlus.java:279)
        at com.ibm.crypto.plus.provider.IBMJCEPlus.a(IBMJCEPlus.java:237)
        at com.ibm.crypto.plus.provider.h.run(h.java:1)
        at java.security.AccessController.doPrivileged(AccessController.java:682)
        at com.ibm.crypto.plus.provider.IBMJCEPlus.<init>(IBMJCEPlus.java:176)
        at java.lang.J9VMInternals.newInstanceImpl(Native Method)
        at java.lang.Class.newInstance(Class.java:2106)
        at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:233)
        at sun.security.jca.ProviderConfig$2.run(ProviderConfig.java:218)
        at java.security.AccessController.doPrivileged(AccessController.java:682)
        at sun.security.jca.ProviderConfig.doLoadProvider(ProviderConfig.java:218)
        at sun.security.jca.ProviderConfig.getProvider(ProviderConfig.java:199)
        at sun.security.jca.ProviderList.getProvider(ProviderList.java:245)
        at sun.security.jca.ProviderList.getService(ProviderList.java:343)
        at sun.security.jca.GetInstance.getInstance(GetInstance.java:169)
        at java.security.Security.getImpl(Security.java:706)
        at java.security.KeyStore.getInstance(KeyStore.java:859)
        at fi.op.p2p.proxy.persistence.security.P2PEncryptionTool.<clinit>(P2PEncryptionTool.java:52)
Caused by: java.security.ProviderException: jgskit (Not found in java.library.path)
        at com.ibm.crypto.plus.provider.IBMJCEPlus.e(IBMJCEPlus.java:138)
        ... 17 more
 
The 2 important criterias to check the problem are:
  1. Error -4306 returns by the Java UDF
  2. Lines in Java Exception:
Caused by: java.security.ProviderException: Failed to initialize IBMJCEPlus provider
Caused by: java.security.ProviderException: jgskit (Not found in java.library.path)
 

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"LOB76","label":"Data Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSFHEG","label":"DB2 Enterprise Server Edition"},"ARM Category":[{"code":"a8m500000008PmjAAE","label":"Routines - Stored Procedures and UDF-\u003EJava\/Non-SQL Routines"}],"ARM Case Number":"TS013290038","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"11.5.0"}]

Log InLog in to view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Document Information

Modified date:
30 April 2025

UID

ibm17005005