+

Search Tips   |   Advanced Search

Data access problems

WebSphere Application Server diagnostic tools provide services to help troubleshoot database connection problems. Additionally, the IBM website provides flexible searching capabilities for finding documented solutions to database-specific connection problems.

This topic references one or more of the application server log files. As a recommended alternative, we can configure the server to use the High Performance Extensible Logging (HPEL) log and trace infrastructure instead of using SystemOut.log , SystemErr.log, trace.log, and activity.log files on distributed and IBM i systems. We can also use HPEL in conjunction with the native z/OS logging facilities. If we are using HPEL, we can access all of the log and trace information using the LogViewer command-line tool from the server profile bin directory. See the information about using HPEL to troubleshoot applications for more information on using HPEL.

The following steps help you quickly isolate connectivity problems.

  1. Browse the log files of the application server for clues.

    See the topic, Setting up the error log.

    See the topic, Viewing JVM logs. By default, these files are app_server_root/server_name/SystemErr.log and SystemOut.log.

    This topic references one or more of the application server log files. As a recommended alternative, we can configure the server to use the High Performance Extensible Logging (HPEL) log and trace infrastructure instead of using SystemOut.log , SystemErr.log, trace.log, and activity.log files on distributed and IBM i systems. We can also use HPEL in conjunction with the native z/OS logging facilities. If we are using HPEL, we can access all of the log and trace information using the LogViewer command-line tool from the server profile bin directory. See the information about using HPEL to troubleshoot applications for more information on using HPEL.

  2. Browse the Helper Class property of the data source to verify that it is correct and that it is on the WAS class path. Mysterious errors or behavior might result from a missing or misnamed Helper Class name. If WAS cannot load the specified class, it uses a default helper class that might not function correctly with the database manager.

  3. Verify that the JNDI name of the data source matches the name used by the client attempting to access it. If error messages indicate that the problem might be naming-related, such as referring to the name server or naming service, or including error IDs beginning with NMSV, look at the topics, Naming related problems, and Troubleshooting the naming service component.

  4. Enable tracing for the resource adapter using the trace specification, RRA=all=enabled. Follow the instructions for dumping and browsing the trace output, to narrow the origin of the problem. See the topic, Enable tracing.

For a comprehensive list of database-specific troubleshooting tips, see the WAS product support page. (Find the link at the end of this article.) In the Search Support field, type a database vendor name among the search terms. Select Solve a problem, then click Search.

Remember that we can always find Support references in the topic, Troubleshooting help from IBM, in this information center.

Currently this information center provides a limited number of troubleshooting tips for the following databases:


General data access problems


IllegalConnectionUseException

This error can occur because a connection obtained from a WAS40DataSource is being used on more than one thread. This usage violates the J2EE 1.3 programming model, and an exception generates when it is detected on the server. This problem occurs for users accessing a data source through servlets or bean-managed persistence (BMP) enterprise beans.

To confirm this problem, examine the code for connection sharing. Code can inadvertently cause sharing by not following the programming model recommendations, for example by storing a connection in an instance variable in a servlet, which can cause use of the connection on multiple threads at the same time.


WTRN0062E: An illegal attempt to enlist multiple one phase capable resources has occurred

This error can occur because:

To correct this error:


ConnectionWaitTimeoutException accessing a data source or resource adapter

If the application receives exceptions like a com.ibm.websphere.ce.cm.ConnectionWaitTimeoutException or com.ibm.websphere.ce.j2c.ConnectionWaitTimeoutException when attempting to access a WAS data source or JCA-compliant resource adapter, some possible causes are:

To correct these problems, either:


com.ibm.websphere.ce.cm.StaleConnectionException: [IBM][CLI Driver] SQL1013N The database alias name or database name "NULL" could not be found

com.ibm.websphere.ce.cm.StaleConnectionException: [IBM][CLI Driver] SQL1013N The database alias name or database name "NULL" could not be found. SQLSTATE=42705. This error occurs when a data source is defined but the databaseName attribute and the corresponding value are not added to the custom properties panel.

To add the databaseName property:

  1. Click Resources > Manage JDBC Providers in the administrative console.

  2. Select the JDBC_provider that supports the problem data source.

  3. Select Data Sources and then select the problem data source.

  4. Under Additional properties, click Custom Properties.

  5. Select the databaseName property, or add one if it does not exist, and enter the actual database name as the value.

  6. Click Apply or OK, and then click Save from the action bar.

  7. Access the data source again.


java.sql.SQLException: java.lang.UnsatisfiedLinkError

This error indicates that the directory containing the binary libraries which support a database are not included in the LIBPATH environment variable for the environment in which the WAS starts.

The path containing the DBM vendor libraries vary by dbm. One way to find them is by scanning for the missing library specified in the error message. Then we can correct the LIBPATH variable to include the missing directory, either in the.profile of the account from which WebSphere Application Server is started, or by adding a statement in a .sh file which then starts the startServer program.

Configure the Java LIBPATH (java.library.path) property with the domain_region_libpath environment variable, like control_region_libpath, server_region_libpath, adjunct_region_libpath. See the topic on changing the values of variables referenced in BBOM0001I messages for instructions on how to set the region libpath variables.


Error J2CA0030E wrapped in error WTRN0063E

"J2CA0030E: Method enlist caught java.lang.IllegalStateException" wrapped in error "WTRN0063E: An illegal attempt to enlist a one phase capable resource with existing two phase capable resources has occurred" when attempting to execute a transaction. This error can occur when last participant support is missing or disabled. Last participant support supports a one-phase capable resource and a two-phase capable resource to enlist within the same transaction.

Last participant support is only available if the following are true:


java.lang.UnsatisfiedLinkError:xaConnect exception when attempting a database operation

This problem has two main causes:


"J2CA0114W: No container-managed authentication alias found for connection factory or data source datasource" when attempting a database operation

This error might occur in the SystemOut.log file when you run an application to access a data source after creating the data source using JACL script.

The error message occurs because the JACL script did not set container-managed authentication alias for CMP connection factory. The JACL is missing the following line:

To correct this problem, add the missing line to the JACL script and run the script again. See the topic, Example: Create a JDBC provider and data source using JMX API and the scripting tool, for a sample JACL script.


Error occurs when you use the ws_ant command to perform the database customization for SQLJ on HP platforms

If you use the ws_ant command to perform the database customization for Structured Query Language in Java (SQLJ) on HP platforms, we can receive an error similar to the following:

[java] [ibm][db2][jcc][sqlj]
[java] [ibm][db2][jcc][sqlj] Begin customization
[java] [ibm][db2][jcc][sqlj] encoding not supported!!
The cause of this error might be that the databases were created using the HP default character set. The Java Common Client (JCC) driver depends on the SDK to perform the code page conversions. The SDK shipped with this product, however, does not support the HP default code page.

Set the LANG to the ISO locale before creating the databases. It should be similar to the following:

Refer to the IBM support site for Information Management software to access the latest technotes for DB2.


Container-managed persistence (CMP) cannot successfully obtain the database access function as defined

When WebSphere Application Server is caching certain generated code that is accessed in the database on the connection factory, and if any changes in the JAR file require regeneration of the database access, the changes are not effective until you stop and restart the server.

Examples of when this failure might occur include:

In summary, if we add or update an enterprise bean containing a custom finder method, stop and then restart the server.


Subtopics


Related concepts

  • Troubleshooting help from IBM
  • Development and assembly tools


    Related tasks

  • Change the values of variables referenced in BBOM0001I messages
  • Use High Performance Extensible Logging to troubleshoot applications
  • View JVM logs
  • Task overview: Accessing data from applications

  • Extensions to data access APIs
  • Application access problems
  • Naming service troubleshooting tips
  • Example: Create a JDBC provider and data source using JMX API and the wsadmin scripting tool Reference topic