Tuesday 18 September 2018

Things that make me go "Hmmm" #12312 - DB2

I was seeing this: -

[18/09/18 13:09:51:395 BST] 0000009f DSConfigurati W   DSRA8201W: DataSource Configuration: DSRA8040I: Failed to connect to the DataSource jdbc/mashupDS.  Encountered java.sql.SQLException: [jcc][t4][10262][11223][4.21.29] Unexpected Throwable caught: null. ERRORCODE=-4228, SQLSTATE=null DSRA0010E: SQL State = null, Error Code = -4,228.

when testing a newly created BPM 8.6 environment.

Having confirmed that DB2 was up-and-running, and that there wasn't a firewall in the way ( both WAS and DB2 are on the same box ), I started digging into the JDBC provider - DB2 Using IBM JCC Driver (XA) - and checked the class path: -

${DB2_JCC_DRIVER_PATH}/db2jcc4.jar
${UNIVERSAL_JDBC_DRIVER_PATH}/db2jcc_license_cu.jar
${DB2_JCC_DRIVER_PATH}/db2jcc_license_cisuz.jar
${PUREQUERY_PATH}/pdq.jar
${PUREQUERY_PATH}/pdqmgmt.jar


and the native path: -

${DB2_JCC_DRIVER_NATIVEPATH}

the latter of which we can ignore as we're using a Type 4 JDBC driver ( db2jcc4.jar ).

I then checked the relevant WebSphere variables: -

DB2_JCC_DRIVER_PATH = ${WAS_INSTALL_ROOT}/jdbcdrivers/DB2  
UNIVERSAL_JDBC_DRIVER_PATH = ${WAS_INSTALL_ROOT}/jdbcdrivers/DB2  
WAS_INSTALL_ROOT = /opt/ibm/WebSphere/AppServer  


and finally checked the files: -

ls -al /opt/ibm/WebSphere/AppServer/jdbcdrivers/DB2

total 3812
drwxr-xr-x. 2 wasadmin wasadmins      83 Sep 18 11:59 .
drwxr-xr-x. 3 wasadmin wasadmins      16 Sep 18 11:59 ..
-rw-r--r--. 1 wasadmin wasadmins 3894263 Sep 18 11:59 db2jcc4.jar
-rw-r--r--. 1 wasadmin wasadmins    2068 Dec  8  2017 db2jcc_license_cisuz.jar
-rw-r--r--. 1 wasadmin wasadmins    1534 Dec  8  2017 db2jcc_license_cu.jar


against that which is provided with my DB2 environment ( v11.1.2.2 ): -

ls -al /opt/ibm/db2/V11.1/java/db2jcc4.jar

-r--r--r--. 1 bin bin 3924511 Jun 11  2017 /opt/ibm/db2/V11.1/java/db2jcc4.jar

Just in case it was a driver conflict, I copied the DB2 driver across: -

mv /opt/ibm/WebSphere/AppServer/jdbcdrivers/DB2/db2jcc4.jar /opt/ibm/WebSphere/AppServer/jdbcdrivers/DB2/db2jcc4.RAJ

cp /opt/ibm/db2/V11.1/java/db2jcc4.jar /opt/ibm/WebSphere/AppServer/jdbcdrivers/DB2

and restarted the Node Agent.

This time around, I got: -

[18/09/18 14:02:54:556 BST] 00000072 DSConfigurati W   DSRA8201W: DataSource Configuration: DSRA8040I: Failed to connect to the DataSource jdbc/mashupDS.  Encountered java.sql.SQLException: null DSRA0010E: SQL State = 58031, Error Code = -1,031.
java.sql.SQLException: null DSRA0010E: SQL State = 58031, Error Code = -1,031


At this point, I started to doubt myself, and double-checked the DB2 server: -

su - db2inst2
db2 list db directory

 System Database Directory

 Number of entries in the directory = 0

Hmmmmm :-( 

Then I realised …..

When I created the databases, I did so as the WRONG USER 

My DB2 server is hosting databases for BOTH MDM *AND* BPM.

The MDM database is hosted by the db2inst1 instance and the BPM databases should be hosted by the db2inst2 instance.

Yes, you've guessed it - I did this: -

su - db2inst1

when I created the BPM databases, rather than this: _

su - db2inst2

Can you say PEBCAK ? I bet you can ……

No comments:

Visual Studio Code - Wow 🙀

Why did I not know that I can merely hit [cmd] [p]  to bring up a search box allowing me to search my project e.g. a repo cloned from GitHub...