DB2 connection failing under tomcat.

Issues and Questions related to running Apache Tomcat on z/OS
Post Reply
dstafford
Posts: 7
Joined: Mon Aug 28, 2006 4:07 pm

DB2 connection failing under tomcat.

Post by dstafford »

Hi,

I have configured the DB2 connection in server.xml as you recommend, and added the necessary tags to provide things like user ids and passwords, etc. The xml file is also configured in Catalina/localhost/newapp.xml as outlined.

However, when trying to connect from a java servlet, I receive no errors, however was able to get the IBM trace information which suggests that that there are no available pooled connections and no used pooled connections.

Here are the contents of /tmp/mytrce.JTRACE

<2006.11.01 15:13:55.652> <Entry> <printHeader> <COM.ibm.db2os390.sqlj.util.DB2SQLJTrace> <http-9090-Processor25>
-- <p#1=Start of DB2 SQLJ/JDBC Tracing <2006.11.01 15:13:55.647>>
-- <p#2=DB2 for OS/390 SQLJ/JDBC Driver build version is: DB2 7.1 PQ69861 JDBC 2.0>

<2006.11.01 15:13:55.659> <Entry> <Constructor> <com.ibm.db2.jcc.DB2ConnectionCache> <http-9090-Processor25>

<2006.11.01 15:13:55.664> <Exit> <Constructor> <com.ibm.db2.jcc.DB2ConnectionCache> <http-9090-Processor25>
-- <p#1=com.ibm.db2.jcc.DB2ConnectionCache@542e98e3[mPoolSize=0;mActiveSize=0;mMaxLimit=100]>

<2006.11.01 15:13:55.675> <Entry> <getConnection> <com.ibm.db2.jcc.DB2ConnectionCache@542e98e3> <http-9090-Processor25>
-- <p#1=databaseName=DSN1>
-- <p#2=PlanName=null>
-- <p#3=username=XXXXXXXX>
-- <p#4=password was specified>

<2006.11.01 15:13:55.680> <Entry> <removeFromPool> <com.ibm.db2.jcc.DB2ConnectionCache@542e98e3> <http-9090-Processor25>
-- <p#1=PlanName=DSNJDBC>

<2006.11.01 15:13:55.686> <Exit> <removeFromPool> <com.ibm.db2.jcc.DB2ConnectionCache@542e98e3> <http-9090-Processor25>
-- <p#1=PooledConnection=null>
-- <p#2=Available PooledConnections=0>
-- <p#3=Total Open PooledConnections=0>

<2006.11.01 15:13:56.060> <Entry> <Constructor> <COM.ibm.db2os390.sqlj.jdbc.DB2SQLJConnection@6a3d58e2> <http-9090-Processor25>
-- <p#1=source=DSN1>
-- <p#2=parser=COM.ibm.db2os390.sqlj.jdbc.parser.DB2JDBCParser@1a6a18e3>
-- <p#3=planname=DSNJDBC>
-- <p#4=pooledConnection=com.ibm.db2.jcc.DB2PooledConnection@7ad4d8e2>

<2006.11.01 15:13:56.163> <Entry> <setError> <COM.ibm.db2os390.sqlj.jdbc.DB2SQLJConnection@6a3d58e2> <http-9090-Processor25>
-- <p#1=DB2SQLJConnection=COM.ibm.db2os390.sqlj.jdbc.DB2SQLJConnection@6a3d58e2[pCONN=0]>
-- <p#2=rc=-1>
-- <p#3=name=DB2SQLJConnection error in native method: constructor: RRS "CREATE THREAD" failed using DB2 system:DSN1, Plan:DSNJDBC , RC=08 and REASON=00f30034

I just can't seem to get this to connect..... Any ideas anyone?
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

From the messages it looks like you are using a "type 2" JDBC connection.

- Is your DB2 subsystem name "DSN1" ?
- Have you verified the configuration of JDBC for DB2?

There is an old how-to on setting up JDBC with Type-2 connections and DB2 7.1 here:

http://jzos.com/docs/jdbc.html
dstafford
Posts: 7
Joined: Mon Aug 28, 2006 4:07 pm

Post by dstafford »

Yes, the subsystem name of our DB2 environment is DSN1

I have run the batch process to configure your sample application to connect to DB/2 with no difficulty. I am able to successfully connect to the DB/2 subsystem using the sample01.class app.

It's just connecting via tomcat that is not working.
dstafford
Posts: 7
Joined: Mon Aug 28, 2006 4:07 pm

Post by dstafford »

Hi, we are one step farther, we are now seeing messages going to DB/2, however are receiving an Error Code = -30061 and an SQL State = 08004

The JES log shows the following:

DSNL031I - DSNLZDJN DRDA EXCEPTION CONDITION IN 412
RESPONSE FROM SERVER LOCATION=DSN1 FOR THREAD WITH
LUWID=BSCNET.LUDB21.BFAA816141A2=6831
REASON=00D351FF
ERROR ID=DSNLZRPA0001
CORRELATION ID=TOMCAT14
CONNECTION ID=RRSAF
IFCID=0191
SEE TRACE RECORD WITH IFCID SEQUENCE NUMBER=00000008

There is no documentation on module DSNLZRPA, section 0001 and an error id of 00D351FF.

Have you ever experienced this problem?

Thank you.
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

I am not familiar with that DB2 error.

Are you saying that you can connect to DB2 -

- under batch? how is it different than under Tomcat?

- under USS with the DB2 sampl01.java program?
does your Tomcat batch STDENV script set the same environment variables? In batch, are the DB2 libraries either in LNKLST or in the JOB/STEPLIB?

- have you lookup up DB2 error message -30061? Are you sure that you have configured the correct database name?
dstafford
Posts: 7
Joined: Mon Aug 28, 2006 4:07 pm

Post by dstafford »

ok, I'm making progress - I have the sample application working under tomcat. Now I understand the difference between the sample app and the one I'm trying to configure - the one I'm trying to configure is trying to make use of a javax.sql.DataSource - so, what I'm trying to determine is how to configure the server.xml to make use of the class "COM.ibm.db2os390.sqlj.jdbc.DB@SQLJDriver" .....
Post Reply