Troubleshooting
Problem
In IBM WebSphere Application Server, an application using a direct JNDI lookup receives the following warning messages in the SystemOut.log.: J2CA0294W: Deprecated usage of direct JNDI lookup of resource Can these messages be suppressed?
Symptom
J2CA0294W: Deprecated usage of direct JNDI lookup of resource jdbc/IOPEntity. The following default values are used: [Resource-ref settings]
res-auth: 1 (APPLICATION)
res-isolation-level: 0 (TRANSACTION_NONE)
res-sharing-scope: true (SHAREABLE)
loginConfigurationName: null
loginConfigProperties: null
[Other attributes]
res-resolution-control: 999 (undefined)
isCMP1_x: false (not CMP1.x)
isJMS: false (not JMS)
res-auth: 1 (APPLICATION)
res-isolation-level: 0 (TRANSACTION_NONE)
res-sharing-scope: true (SHAREABLE)
loginConfigurationName: null
loginConfigProperties: null
[Other attributes]
res-resolution-control: 999 (undefined)
isCMP1_x: false (not CMP1.x)
isJMS: false (not JMS)
Cause
Although you can use a direct JNDI name (e.g. jdbc/DataSource), this naming method is deprecated in WebSphere Application Server beginning with V6.0. The application server assigns default values to the resource-reference data when you use this method. An informational message, resembling the following, is logged to document the defaults:
- J2CA0294W: Deprecated usage of direct JNDI lookup of resource jdbc/IOPEntity. The following default values are used: [Resource-ref settings]
res-auth: 1 (APPLICATION)
res-isolation-level: 0 (TRANSACTION_NONE)
res-sharing-scope: true (SHAREABLE)
loginConfigurationName: null
loginConfigProperties: null
[Other attributes]
res-resolution-control: 999 (undefined)
isCMP1_x: false (not CMP1.x)
isJMS: false (not JMS)
Diagnosing The Problem
These defaults may have undesirable effects on your application. The res-auth of 1 (APPLICATION) means that your application will use the component-managed authentication alias.
The res-isolation-level of 0 means that the default isolation level will be used. The default is REPEATABLE_READ; this default can be changed by the data source custom property webSphereDefaultIsolationLevel.
The res-sharing-scope of SHAREABLE can lead to J2CA0045E errors for servlets that get multiple DB connections during their lifecycle. See article for more details Default behavior of managed connections in WebSphere Application Server
The res-isolation-level of 0 means that the default isolation level will be used. The default is REPEATABLE_READ; this default can be changed by the data source custom property webSphereDefaultIsolationLevel.
The res-sharing-scope of SHAREABLE can lead to J2CA0045E errors for servlets that get multiple DB connections during their lifecycle. See article for more details Default behavior of managed connections in WebSphere Application Server
Resolving The Problem
The application should be changed to use an indirect JNDI name instead of the direct JNDI name and a resource reference should be created. See IBM Documentation, section Connection factory JNDI name practices for more information.
*=info:com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl=severe
A setting of severe for that class will suppress the logging of warning and lower levels. See the product documentation, section Log level settings for more information. However, this should be considered an interim solution until the application can be updated.
For instructions on how to set the logging level, see IBM Documentation, section Enabling tracing and logging.
For instructions on how to create resource reference, see section Creating or changing a resource reference
It is possible to suppress the warning message J2CA0294W from the SystemOut.log, by setting the logging level:
*=info:com.ibm.ejs.j2c.ConnectionFactoryBuilderImpl=severe
A setting of severe for that class will suppress the logging of warning and lower levels. See the product documentation, section Log level settings for more information. However, this should be considered an interim solution until the application can be updated.
For instructions on how to set the logging level, see IBM Documentation, section Enabling tracing and logging.
For instructions on how to create resource reference, see section Creating or changing a resource reference
[{"Line of Business":{"code":"LOB45","label":"Automation"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"ARM Category":[{"code":"a8m50000000CdN3AAK","label":"WebSphere Application Server traditional-All Platforms-\u003EORB-Naming-\u003EJNDI Naming"}],"Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF012","label":"IBM i"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"},{"code":"PF035","label":"z\/OS"}],"Version":"8.5.5;9.0.5","Type":"MASTER"}]
Was this topic helpful?
Document Information
Modified date:
01 February 2022
UID
swg21220886