Troubleshooting
Problem
If your application uses WebSphere Application Server schedulers, you might see an error indicating that the database tables used by the scheduler are missing or not accessible. However, when you confirm by looking into the database, the tables actually exist.
Symptom
This error can be seen in the SystemOut.log file, and can manifest itself in many forms, some of which are listed below:
- In the case of DB2, an SQL error of the form:
Error: SQLCODE=-204, SQLSTATE=42704
Note: An appropriate error code will be thrown for other databases.
- LeaseManagerNotAvailableException
- SchedulerNotAvailableException
- The table used by the scheduler resource is missing or is not accessible.
Cause
To use the WebSphere Application Server scheduler service in an application, schedulers can be configured using the administrative console or wsadmin scripting. The tables needed by the scheduler can be created using the administrative console, wsadmin, or using Data Definition Language (DDL) files provided under the install_root/Scheduler directory.
When the DDL files are used to create tables in WebSphere Application Server V7.0, a schema name can be provided in addition to the table prefix. This results in the tables being created under the specified schema.
The scheduler created using the administrative console or wsadmin scripting would have been configured without a schema name. As a result, the scheduler tries to access the tables in the database without a qualifying schema name. A default schema name is used in such a case and this name depends on the database being used. For example, in the case of DB2, the user ID configured in the data source is used as the schema name (refer the various database documentation to know what schema name is used by default). Therefore, though the actual tables exist, but with a different schema name, which is provided during table creation, the scheduler throws an error that the table is missing or is not accessible.
Resolving The Problem
To resolve the problem of having different schema names while creating the table, and while accessing the scheduler, the scheduler can be configured to use the same schema name that the tables were created with.
To configure the schema name, the Table Prefix field under the scheduler panel in the administrative console can be used. Specify the schema name as a prefix to the Table Prefix, separated by a period (.). For example, if the schema name is “user1” and the table prefix is "DEV", specify “user1.DEV” in the Table Prefix field.
The same can also be achieved using Jacl or Jython scripting.
This solution is applicable for all WebSphere Application Server supported databases.
Was this topic helpful?
Document Information
Modified date:
15 June 2018
UID
swg21429487