Wednesday, May 22, 2013

Err : Caused by: java.lang.SecurityException: User: weblogic, failed to be authenticated.

Hello Guys,

Sometimes you will have a tough time dealing with simple issues with WebLogic, same goes for this one. Today we will see what are the options of fix we have when we see some simple Authentication Issues, and these issues may eat up a big chunk of your brain figuring out the fix when everyone is watching you waiting for you to show some results, huh.!! that's really a tough time - that goes beyond when you are on call on bridge with customer waiting on his patience.

Lets find out some simple ways to fix this issue.

Normally the issue will look like very frightening one as it just throws out big stack trace resulting into failing the current operation, probably it will be StopServer or StartServer..

[root@localhost bin]# ./
Stopping Weblogic Server...

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

Please enter your username :weblogic
Please enter your password :
Connecting to t3://localhost:7001 with userid weblogic ...
This Exception occurred at Tue May 21 18:55:12 PDT 2013.
javax.naming.AuthenticationException [Root exception is java.lang.SecurityException: User: weblogic, failed to be authenticated.]
        at weblogic.jndi.internal.ExceptionTranslator.toNamingException(
        at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(
        at weblogic.jndi.WLInitialContextFactoryDelegate.pushSubject(
        at weblogic.jndi.WLInitialContextFactoryDelegate.newContext(
        at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(
        at weblogic.jndi.Environment.getContext(
        at weblogic.jndi.Environment.getContext(
        at weblogic.jndi.WLInitialContextFactory.getInitialContext(
        at javax.naming.spi.NamingManager.getInitialContext(
        at javax.naming.InitialContext.getDefaultInitCtx(
        at javax.naming.InitialContext.init(
        at javax.naming.InitialContext.<init>(
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.lang.reflect.Method.invoke(
        at org.python.core.PyReflectedFunction.__call__(Unknown Source)
        at org.python.core.PyMethod.__call__(Unknown Source)
        at org.python.core.PyObject.__call__(Unknown Source)
        at org.python.core.PyObject.invoke(Unknown Source)
        at org.python.pycode._pyx4.connect$1(<iostream>:16)
        at org.python.pycode._pyx4.call_function(<iostream>)
        at Source)
        at Source)
        at org.python.core.PyFunction.__call__(Unknown Source)
        at org.python.pycode._pyx15.f$0(/cust/weblogic/middleware/domains/xyz_domain/
        at org.python.pycode._pyx15.call_function(/Oracle/weblogic/middleware/domains/xyz_domain/
        at Source)
        at Source)
        at org.python.core.Py.runCode(Unknown Source)
        at org.python.util.PythonInterpreter.execfile(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.lang.reflect.Method.invoke(
        at weblogic.WLST.main(
Caused by: java.lang.SecurityException: User: weblogic, failed to be authenticated.
        at weblogic.common.internal.RMIBootServiceImpl.authenticate(
        at weblogic.common.internal.RMIBootServiceImpl_WLSkel.invoke(Unknown Source)
        at weblogic.rmi.internal.BasicServerRef.invoke(
        at weblogic.rmi.internal.BasicServerRef$
        at weblogic.rmi.internal.BasicServerRef.handleRequest(
Problem invoking WLST - Traceback (innermost last):
  File "/Oracle/weblogic/middleware/domains/xyz_domain/", line 6, in ?
  File "<iostream>", line 22, in connect
  File "<iostream>", line 646, in raiseWLSTException
WLSTException: Error occured while performing connect : User: weblogic, failed to be authenticated.
Use dumpStack() to view the full stacktrace

Stopping Derby Server...
[root@localhost bin]#

At this point of time you will get baffled and do not understand what you will be doing as next?

Relax.. There are few instances where you have to look for solution.

  1. Possible corruption of
  2. Possible corruption of Embedded LDAP
  3. User Name or Password is Wrong in
Instance 1 Possible corruption of

Whenever you face the problem like the above you may have to look into the files which are present at servers/security folder <domain/servers/servername/security>, if the entries are encrypted and are looking fine you can ignore, however you can make sure by creating another one with same values of username and password in the following format and save it under servername/security folder as


And make sure you have in required location.

Instance 2 : Possible corruption of Embedded LDAP

Chances of this Instance are more when compared to ones, as whenever you shutdown the server improperly or if there are any mis-configuration with authentication data or if there are any changes in the environment where WebLogic Server is present, we have more chances of getting Embedded LDAP Corrupted.

To deal with this issue, we just have few simple steps :
1) Go to <domain>/servers/<serverName>/data/
2) Take Backup or Rename ldap folder
3) Restart Server

Here you will see that a new ldap folder gets created, but you will still have error starting up the server in case if you have changed your username and passwords after your setup.

In case if you see issues still then you have one option to fix it.

  1. Take a backup of ldapfiles Folder from new ldap directory
  2. Copy the ldapfiles from Old backed up ldap folder before you have restarted the server
  3. And Restart the server again.
With this you have more chances of fixing the issue

Instance 3 : User Name or Password is Wrong in

This can be considered as Human Error as you need to remember the username and password you have specified, unless you do you will not be able to fix username and password issue.

Alright guys..!!

I believe with this you will be able to see hope of appreciation from your client/ customer.. in case if you think, I am not done.. please request you send me a mail or comment on this post so that I can reply with more options of fixes for similar type weird issues..

If you get any other issues with WebLogic Server / WebSphere Server  and Web Servers.. please drop me a mail here

Shailesh Dyade

No comments: