Tuesday, January 19, 2016

ORA-01017: invalid username/password; logon denied when updating WebLogic data source and you know the username and password are correct

Background

The title might sound a bit confusing, because everyone that has experienced an ORA-01017 knows it only happens if either the database username or password is incorrect.

I recently had to change the password for all of the infrastructure component schemas in a Oracle® SOA Suite 12.1.3 installation. How to do it is documented at https://docs.oracle.com/middleware/1213/core/ASADM/repos.htm#ASADM637

After running the modifyBootStrapCredential for the OPSS configuration I expected everything to be dandy except a few ORA-01017 errors for the data sources I had not yet updated with the new password. Everything I needed to do was to edit each data source and provide the new password. Or so I thought...

The problem

When I tried to apply the changes I got the following ORA-01017 error for each data source I tried to edit:


I was a bit thunderstruck at first because the username and passwords worked fine in both SQL*Plus and in SQL Developer.

The AdminServer out file contained errors like this:
<Jan 19, 2016 1:15:54 PM UTC> <Error> <Deployer> <BEA-149205> <Failed to initialize the application "LocalSvcTblDataSource" due to error weblogic.application.ModuleException: weblogic.common.resourcepool.ResourceSystemException:
 Could not create connection for datasource '<data source name>'.

 The returned message is: ORA-01017: invalid username/password; logon denied

 It is likely that the login or password is not valid.
 It is also possible that something else is invalid in
 the configuration or that the database is not available.
weblogic.application.ModuleException: weblogic.common.resourcepool.ResourceSystemException:
 Could not create connection for datasource '<data source name>'.

 The returned message is: ORA-01017: invalid username/password; logon denied

 It is likely that the login or password is not valid.
 It is also possible that something else is invalid in
 the configuration or that the database is not available.
        at weblogic.jdbc.module.JDBCModule.prepare(JDBCModule.java:350)
        at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:100)
        at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:175)
        at weblogic.application.internal.flow.ModuleStateDriver$1.next(ModuleStateDriver.java:170)
        at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:42)
        Truncated. see log file for complete stacktrace
Caused By: weblogic.common.resourcepool.ResourceSystemException:
 Could not create connection for datasource '<data source name>'.

 The returned message is: ORA-01017: invalid username/password; logon denied

 It is likely that the login or password is not valid.
 It is also possible that something else is invalid in
 the configuration or that the database is not available.
        at weblogic.jdbc.common.internal.JDBCUtil.parseException(JDBCUtil.java:322)
        at weblogic.jdbc.common.internal.ConnectionEnvFactory.makeConnection0(ConnectionEnvFactory.java:492)
        at weblogic.jdbc.common.internal.ConnectionEnvFactory.access$000(ConnectionEnvFactory.java:20)
        at weblogic.jdbc.common.internal.ConnectionEnvFactory$1.run(ConnectionEnvFactory.java:388)
        at java.security.AccessController.doPrivileged(Native Method)
        Truncated. see log file for complete stacktrace
>

The workaround

For each data source I had to do the following to work around this problem:

  1. Clicked the Lock & Edit button.
  2. Had to note which targets the data source was using.
  3. Removed the targets from the data source, and clicked on the Save button.
  4. Clicked on the Activate Changes button.
  5. Clicked the Lock & Edit button.
  6. Updated the password for the data source, and clicked on the Save button.
  7. Clicked on the Activate Changes button.
  8. Clicked the Lock & Edit button.
  9. Added the targets that I noted in step 2 to the data source, before I clicked on the Save button.
  10. Clicked the Activate Changes button.

After all data sources had been updated with the new passwords, and the data sources had been re-targeted, I did a full domain restart. 

While I started the AdminServer up, I looked out for errors like these which could indicate I had forgotten to update some data sources:

<Jan 19, 2016 1:32:34 PM UTC> <Error> <Deployer> <BEA-149205> <Failed to initialize the application "<data source name>" due to error weblogic.application.ModuleException: weblogic.common.resourcepool.ResourceSystemException

10 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Brilliant - that worked for me!

    BTW, how did you come across this solution?

    Also, step (10) should say "Activate Changes" instead of "Lock & Edit".
    After that, I just restarted the data source itself instead of a full domain restart and it restarted succesfully whereas earlier it hit ORA-01017. That was from the "Control" tab under settings for the datasource.

    Much appreciated.

    ReplyDelete
    Replies
    1. Thanks for spotting the issue in step 10. I'll fix that later today.

      Regarding the question: I like to tinker and try things out. I'm probably better at trial and error than reading the documentation from front to back. For this specific issue though, it is not the first time I've seen Weblogic use old values. Sometimes when you redeploy you also see it use classes from your previous deploy.

      Delete
  3. You are my hero of the day. Solution worked like a charm - appreciate your posting this.

    ReplyDelete
    Replies
    1. Thanks for the feedback. I am glad you found it useful :)

      Delete
  4. Many thanks, your solution worked smoothly...

    ReplyDelete
  5. You saved my day. Thanks a lot ;)

    ReplyDelete
  6. I Have Same Error in My JDeveloper 12.2.1.3 If I Run Weblogic server Can u Help Me

    ReplyDelete
  7. Much appreciate the solution provided. Can anyone comment on the RCA of the issue caused.

    Thanks in advance.

    ReplyDelete
  8. Fantastic, I was having difficulty in bringing back the UI after changing the password, these steps help me in resolving the issue. thanks so much.

    ReplyDelete