views:

104

answers:

3

In WebSphere 6.1 I have created a datasource to an Oracle 11g instance using the thin JDBC client.

In Oracle I have two users, one existing and another newly created.

My websphere datasource is OK if I use the component-managed authentication alias of the existing user, but fails with "invalid user/password" message if I use the alias of the new user. The error message is:

The test connection operation failed for data source MyDB (Non-XA) on 
server nodeagent at node MY_node with the following exception: 
java.sql.SQLException: ORA-01017: invalid username/password; 
logon denied DSRA0010E: SQL State = 72000, Error Code = 1,017. 
View JVM logs for further details.

There is nothing in the JVM logs. I have grepped all websphere logs and they do not mention my connection at all.

I can confirm that the username and password are correct by logging in via SQLPlus or (to prove the JDBC connection is OK) via SQuirreL.

I have checked in Oracle that the new user has all the system privs that the existing user has.

Any thoughts on what is going on or how I can debug this further?

+1  A: 

If this happens to anyone else, I restarted WebSphere and all my problems went away. It's a true hallmark of quality software.

Synesso
If you change the configuration in WAS (you are doing that as you are changing the credentials of a JAAS alias) you are likely to have a restart of the server for it to take effect.
Manglu
+1  A: 

Oftentimes when people tell me they can't log into Oracle 11g with the correct password, I know they've been caught out by passwords becoming case-sensitive between 10g and 11g.

Gaius
They weren't case sensitive before? **wow!**
Synesso
Nope! Remember that Oracle goes way back in the day when you couldn't even assume that your client would be capable of mixed case. Even in 11g it's optional.
Gaius
+3  A: 

Just FYI. I am guessing you are running WebSphere in "Network Deployment" mode. This behavior you're experiencing is actually by design.

The reason for it is that the "Test Connection" button you see on the admin console, invokes the JDBC connection test from within the address-space of the Node Agent. There is no way for the J2C Alias information to propagate to the Node Agent without restarting it; some configuration objects take effect in WebSphere as soon as you save the configuration to the master repository, and some only take effect on a restart. J2C aliases take effect on restarts.

In a Network Deployment topology, you may have 10 server instances all controlled by the same Node Agent. You may restart your server instances many times, but unless you restart the Node Agent itself, the "test connection" button will never work.

It's a known WebSphere limitation... Which also exists on version 7.0, so don't be surprised when you test it during your next migration. :-)

Isaac