IBM Support

java.lang.NullPointerException using DB2 Universal JDBC Type 4 XA driver connecting to DB2 V8.1 Fix Pack 7

Troubleshooting


Problem

You receive java.lang.NullPointerException when using DB2® Universal JDBC type 4 XA JDBC driver connecting to DB2 V8.1 Fix Pack 7.

Symptom

Excerpt of stack trace:

Exception in thread "main" java.lang.NullPointerException
    at com.ibm.db2.jcc.a.c.l(c.java:387)
    at com.ibm.db2.jcc.b.o.k(o.java:1095)
    at com.ibm.db2.jcc.b.o.x(o.java:1316)
    at com.ibm.db2.jcc.b.o.u(o.java:1288)
    at com.ibm.db2.jcc.b.o.s(o.java:1270)
    at com.ibm.db2.jcc.a.c.s(c.java:568)
    at com.ibm.db2.jcc.b.o.db(o.java:3078)
    at com.ibm.db2.jcc.b.o.cb(o.java:3049)
    at com.ibm.db2.jcc.a.b.cb(b.java:629)
    at com.ibm.db2.jcc.a.b.a(b.java:409)
    at com.ibm.db2.jcc.a.b.<init>(b.java:332)
    at com.ibm.db2.jcc.a.c.<init>(c.java:38)
    at com.ibm.db2.jcc.DB2PooledConnection.<init>(DB2PooledConnection.java:122)
    at com.ibm.db2.jcc.DB2XAConnection.<init>(DB2XAConnection.java:33)

The version of the IBM Universal JDBC driver in use is not licensed for
connectivity to DB2 for Unix/Windows databases. To connect to this DB2
server, please obtain a licensed copy of the IBM DB2 Universal Driver
for JDBC and SQLJ. An appropriate license file db2jcc_license_*.jar for
this target platform must be installed to the application classpath.
Connectivity to DB2 for Unix/Windows databases is enabled by any of the
following license files: { db2jcc_license_cu.jar,
db2jcc_license_cisuz.jar }

Exception in thread "main" com.ibm.db2.jcc.b.SqlException: The version
of the IBM Universal JDBC driver in use is not licensed for connectivity
to DB2 for Unix/Windows databases. To connect to this DB2 server,
please obtain a licensed copy of the IBM DB2 Universal Driver for JDBC
and SQLJ. An appropriate license file db2jcc_license_*.jar for this
target platform must be installed to the application classpath.
Connectivity to DB2 for Unix/Windows databases is enabled by any of the
following license files: { db2jcc_license_cu.jar,
db2jcc_license_cisuz.jar }

[10/20/05 10:40:31:672 EDT] 4bc15f63 DataSourceCon E DSRA8040I: Failed
to connect to the DataSource. Encountered : java.lang.Exception:
com.ibm.db2.jcc.a.SqlException: The version of the IBM Universal JDBC
driver in use is not licensed for connectivity to QDB2/AIX64 databases.
To connect to this DB2 server, please obtain a licensed copy of the IBM
DB2 Universal Driver for JDBC and SQLJ. An appropriate license file
db2jcc_license_*.jar for this target platform must be installed to the
application classpath. Connectivity to QDB2/AIX64 databases is enabled
by any of the following license files: { db2jcc_license_cu.jar,
db2jcc_license_cisuz.jar }

Cause

The license .jar files are missing from the classpath of the JDBC provider's configuration.

Resolving The Problem

Edit your JDBC provider and update the classpath to include the license's .jar files:

[{"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"DB Connections\/Connection Pooling","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF012","label":"IBM i"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"},{"code":"PF035","label":"z\/OS"}],"Version":"9.0;8.5.5;8.0;7.0","Edition":"Base;Network Deployment","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSNVBF","label":"Runtimes for Java Technology"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Java SDK","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB36","label":"IBM Automation"}}]

Document Information

Modified date:
15 June 2018

UID

swg21212113