The attempt to connect to a data source using WebSphere
Application Server fails with one of the following error messages:
DSRA0040E: WebSphere internal error occurred.
DSRA8040I: Failed to connect to the DataSource.
DSRA8100E: Unable to get a XAConnection from the DataSource.
If you have already contacted support, continue on to the DB Connectivity
(DB2) MustGather information. Otherwise, click: MustGather:
Read first for all WebSphere Application Server products.
DB Connectivity (DB2) specific MustGather information
- Provide the following information about the database client
- The DB2 level that is used; provide the output from the
db2level command. This should be done using the DB2 administrative id and
db2 should be started.
To get detail information about the database level and FixPak, we use the
db2level command:
>> db2level
DB21085I Instance "db2udb1" uses DB2 code release "SQL07025" with
level identifier "03060105" and informational tokens "DB2 v7.1.0.20",
"s020616" and "U484483".
- The driver used to connect to the database (that is, what
was selected from the drop down list on the JDBC Providers screen:
DB2 Universal JDBC Driver Provider
DB2 Universal JDBC Driver Provider (XA)
DB2 Legacy CLI -based Type 2 JDBC Driver
DB2 Legacy CLI -based Type 2 JDBC Driver (XA)
DB2 UDB for ISeries (Native - V5R2 and later)
DB2 UDB for ISeries (Native XA - V5R2 and later)
DB2 UDB for ISeries (Native - V5R1 and earlier)
DB2 UDB for ISeries (Native XA - V5R1 and earlier)
DB2 UDB for ISeries (Toolbox)
DB2 UDB for ISeries (Toolbox XA)
- The data source name an indication whether this is a WAS
V4 data source or a WebSphere Application Server V5.0 or V5.1 data
source
- The Classpath and Native library path for the JDBC
Datasource.
- Provide the following information about the database server
- The DB2 version used by the server by running db2level on
the server.
- The operating system of the server
- Note: WebSphere Application Server does not support 64-bit
client drivers, but it does support connecting to a 64-bit database
server.
- Provide the following information about the network configuration
between WebSphere Application Server and the DB Server
- an indication whether the DB server is remote (on a
different physical server) than WebSphere Application Server
- Is there a firewall between WebSphere Application Server
and the database server?
- If the data source has just been configured or the configuration has
just been changed, stop and restart WebSphere Application Server to see if
this resolves the problem.
- Check the WebSphere Application Server logs for the server that the
database is defined on for errors that may indicate that the database
driver did not load. In particular, check the SystemErr.log.
The java.lang.UnsatisfiedLinkError will look similar to this.
[8/23/04 10:35:25:640 CDT] 61989412 SystemErr R
java.lang.UnsatisfiedLinkError: SQLBindChar
[8/23/04 10:35:25:640 CDT] 61989412 SystemErr R
at
COM.ibm.db2.jdbc.app.DB2PreparedStatement.execute2(DB2PreparedStatement.java(Compiled
Code))
[8/23/04 10:35:25:640 CDT] 61989412 SystemErr R
at
COM.ibm.db2.jdbc.app.DB2PreparedStatement.executeQuery(DB2PreparedStatement.java(Compiled
Code))
This error indicates that a
library or dll needed by DB2 could not be found. Some of the possible
reasons for this are:
- This could be due to the path information configuration
being incorrect.
- This could be a permissions problem accessing the
library.
- This could be caused by accessing a 32-bit JDBC library
from a 64-bit jvm or it could be caused by accessing a 64-bit JDBC library
from a 32-bit jvm.
- Test the connection using the Test Connection button. The Test
Connection button will use either the Container-managed authentication or
the Component-managed authentication.
- If the TestConnection is successful, but the application
is not successful, then this means that the application is not configured
to use the correct authentication mechanism. If there is a J2CA0122I
message logged prior to the application failing to connect to the
database, then the application used Component-managed authentication,
since this is the default. If the application is not specifying a userid
and password programmatically, then the solution is either to use an
indirect reference to look up the resource in the application, that is a
java:comp/env reference OR to configure a Component-managed authentication
alias for the data source. Also, refer to the technote, Receive
J2CA0122I message during JNDI lookup of data source or connection
factory
- If the TestConnection fails but the application is
successful, then it is because the application is specifying a different
userid/password within the application and Component-managed
authentication is being used by the application.
- If the test connection fails due to a problem with the
userid and password, then refer to technotes Choosing
an Authentication Alias type for Java™ 2 Connector Architecture (J2C)
Resource Connection Factory and Test
Connection fails with 'java.sql.SQLException: invalid arguments in call'
when using Version 5 datasource for more assistance.
- Test connecting to the data source from a DB2 command line. If this is
successful, then this means that the connectivity to the database server
is ok.
- If by this point, the problem is not resolved, enable a WebSphere
trace.
- WebSphere Application Server V5.0:Enable the following
trace:
com.ibm.ejs.jts.*=all=enabled:EJBContainer=all=enabled:PMGR=all=enabled:WAS.j2c=all=enabled:RRA=all=enabled:WAS.database=all=enabled
- WebSphere Application Server V5.1:Enable the following
trace:
Transaction=all=enabled:EJBContainer=all=enabled:PMGR=all=enabled:WAS.j2c=all=enabled:RRA=all=enabled:WAS.database=all=enabled
- Run the Collector tool for WebSphere Application Server to gather the
trace and logs files
- Run the db2support command to gather the DB2 log data;
this will get the db2diag.log. This is the command that is recommended to
run. Run this as the DB2 administrative user:
db2support . -s
See this link for more information on the db2support
command.
- Gather the following
- Collector tool output
- Output from the db2level command
- Output of db2support command
- Responses to questions, above
- Follow instructions to send
diagnostic information to IBM support.
For a listing of all technotes, downloads, and educational materials
specific to the DB Connectivity (DB2) component, search the WebSphere
Application Server support site. |