IBM Support

J2CA0294W: Deprecated usage of direct JNDI lookup of resource

Technote (troubleshooting)


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?


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

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 Information Center, section Connection factory JNDI name tips for more information.

It is possible to suppress the warning message J2CA0294W from the SystemOut.log, by setting the logging level:


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 Information Center, section Enabling tracing and logging.
For instructions on how to create resource reference, see Information Center section Creating or changing a resource reference

Cross reference information
Segment Product Component Platform Version Edition
Application Servers Runtimes for Java Technology Java SDK

Document information

More support for: WebSphere Application Server
DB Connections/Connection Pooling

Software version: 7.0, 8.0, 8.5, 8.5.5

Operating system(s): AIX, HP-UX, IBM i, Linux, Solaris, Windows, z/OS

Reference #: 1220886

Modified date: 07 June 2007

Translate this page: