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.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:
- db2jcc_license_cu.jar
This is the DB2 Universal JDBC driver license file that allows access to the DB2 Universal database. Use this JAR file or the following one to gain access to the database. This JAR file ships with WebSphere® Application Server in a directory defined by the following environment variable:
- db2jcc_license_cisuz.jar
This is the DB2 Universal JDBC driver license file that allows access to the following databases: - DB2 Universal
- DB2 for iSeries®
- DB2 for z/OS®
- SQLDS
${UNIVERSAL_JDBC_DRIVER_PATH} |
The classpath for the provider is set as follows:
${DB2UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc.jar ${UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc_license_cu.jar ${DB2UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc_license_cisuz.jar |
The db2jcc_license_cisuz.jar does not ship with WebSphere Application Server and should be located in the same directory as the db2jcc.jar file, so that the DB2UNIVERSAL_JDBC_DRIVER_PATH points to both. The db2jcc_license_cisuz.jar file is included in all DB2 Connect server editions including DB2 Connect Personal Edition. The license is also part the IBM Database Enterprise Developer Edition. If you already have one of these products, then please use the license file from the DB2 Connect Activation CD. If you have a Passport Advantage account, then remember to download the activation key from Passport Advantage for the DB2 Connect edition that you have purchased.
The db2jcc_license_cisuz.jar file is located in the /db2/license directory of the activation CD or activation file downloaded from Passport Advantage.
[{"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"}}]
Was this topic helpful?
Document Information
Modified date:
15 June 2018
UID
swg21212113