This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Websphere and the fly likes JDBC issue with JNDI lookup Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "JDBC issue with JNDI lookup" Watch "JDBC issue with JNDI lookup" New topic

JDBC issue with JNDI lookup

eric mcentee
Ranch Hand

Joined: May 02, 2001
Posts: 66
Hello, I was hoping someone might have run into something like this.
I am porting an existing Weblogic application to WAS5.1. In the Weblogic application, datasources are referred to by their JNDI names.
My application is working in WAS, but I get this info message:
[1/9/04 16:01:04:505 EST] 4a84ce88 ConnectionFac I J2CA0122I: Resource reference NCRCRMDB could not be located, so default values of the following are used: [Resource-ref settings]
res-auth: 1 (APPLICATION)
res-isolation-level: 0 (TRANSACTION_NONE)
res-sharing-scope: true (SHAREABLE)
res-resolution-control: 999 (undefined)
[Other attributes]
isCMP1_x: false (not CMP1.x)
isJMS: false (not JMS)

I found on an IBM pub site that this means that since I am referencing the datasource via JNDI directly the container can't manage these values, so it sets defaults.
Has anyone seen something similar, and if so, have you been able to solve it? It's my impression that this is akin to a warning since the code works, but the log is getting filled with these.
Eric McEntee
Ranch Hand

Joined: Jun 03, 2001
Posts: 47
Go to EJB Deployment Descriptor, click on references tab, Click on Add button at the bottom, select Resource reference radio button.
Name = (New ResourceRef) - replace this with the jndi name you gave in ur program. For example if you gave java:comp/env/jdbc/testds, type jdbc/typeds.
Type = javax.sql.DataSource (Make sure you havent selected javax.activation.DataSource)
Autentication: CONTAINER
Under Websphere Bindings
jndiname - name you gave while created your datasource (ie jdbc/typeds)
Save everything and Restart your server.
eric mcentee
Ranch Hand

Joined: May 02, 2001
Posts: 66
Sorry, excuse my ignorance, I'm a WAS newbie. Where do I find this EJB Deployment Descriptor menu? Is this through the admin console, or WSAD?
Ranch Hand

Joined: Jun 03, 2001
Posts: 47
Its using WSAD, If you want the same be done in WAS also using different approach.
Adi Ma

Joined: Aug 11, 2004
Posts: 2
How do you do it using WAS?
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: JDBC issue with JNDI lookup
Similar Threads
Datasource could not be located in Websphere5.0 connecting with SQL Server
Problem while fetching connection object through Websphere configured DataSource
Deprecated usage of direct JNDI lookup
JMS and Websphere 6
Websphere6.1-JNDI Issue