"Java.lang.UnsatisfiedLinkError: xaConnect" error is received when trying to use a XA data source with DB2 Legacy CLI driver in WebSphere Application Server V5
 Technote (troubleshooting)
 
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:
  1. Source the db2profile.
  2. Specify the JDBC provider class path
  3. 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
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > DB Connections/Connection Pooling
Operating system(s): Solaris
Software version: 5.1.1
Software edition:
Reference #: 1255835
IBM Group: Software Group
Modified date: Feb 26, 2007