|
Problem(Abstract) |
The "java.lang.UnsatisfiedLinkError: xaConnect" error
occurs either when testing the connection using the IBM® WebSphere®
Application Server Administrative Console or when using the datasource
from the application.
This error occurs when using the IBM DB2® Legacy CLI-based Type 2 driver.
Testing from the Administrative Console results in an error similar to the
following:
"Test Connection failed for datasource <datasource_name> on
server <server_name> at
node <node_name> with the following exception:
java.sql.SQLException:
java.lang.UnsatisfiedLinkError: xaConnect. View JVM logs for further
details. null"
Using the datasource from the application can result in various different
errors, however, within each exception's stacktrace, the
"java.lang.UnsatisfiedLinkError: xaConnect" will appear. The following is
one example that occurs when accessing the datasource from WebSphere
Portal Server. This error appears in the log file for WebSphere Portal
Server:
Caused by: javax.ejb.CreateException:
com.ibm.websphere.naming.CannotInstantiateObjectException: Exception
occurred while the JNDI NamingManager was processing a
javax.naming.Reference object. [Root exception is
com.ibm.websphere.naming.CannotInstantiateObjectException: Exception
occurred while the JNDI NamingManager was processing a
javax.naming.Reference object. [Root exception is
java.lang.UnsatisfiedLinkError: xaConnect]]
at
com.ibm.wps.datastore.ejb.cleanup.SchedulerManagerBean.ejbCreate(SchedulerManagerBean.java:103)
... 62 more |
|
|
|
Cause |
The cause of this error is a misconfiguration of the
WebSphere Application Server environment, not a defect with the
Application Server code itself. The application server attempts to load a
native library needed by DB2 but since it does not know where it is, the
error occurs. |
|
|
Resolving the
problem |
The solution is to configure WebSphere Application Server
for DB2 Access:
- Source the db2profile.
- Specify the JDBC provider class path
- Set DB2-required environment variables for a particular application
server:
These steps are described in detail in this Information Center document:
Configuring
WebSphere Application Server for DB2 Access
It is important to note that the environment variables in Step 3 must
be configured for each application server (JVM) that requires DB2
access.
|
|
|
|
|
Cross Reference information |
Segment |
Product |
Component |
Platform |
Version |
Edition |
Application Servers |
Runtimes for Java Technology |
Java SDK |
|
|
|
|
|
|