Symptoms

Reports have occurred that users are unable to stop WebLogic Server using stopWebLogic.sh with the following error:

Connecting to t3://hostname.domainname:2001 with userid {AES}qFA3rQexfsasfgjdf560srqyGQ15UNglcziS0uR1yJQw= ...
This Exception occurred at Wed Feb 02 16:31:32 PST 2011.
javax.naming.AuthenticationException [Root exception is java.lang.SecurityException: User:
{AES}qFA3rQexfsasfgjdf560srqyGQ15UNglcziS0uR1yJQw, failed to be authenticated.]
at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:42)
at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:787)
at weblogic.jndi.WLInitialContextFactoryDelegate.pushSubject(WLInitialContextFactoryDelegate.java:681)
at weblogic.jndi.WLInitialContextFactoryDelegate.newContext(WLInitialContextFactoryDelegate.java:469)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:376)
at weblogic.jndi.Environment.getContext(Environment.java:315)



Cause

This issue was occurring because stopWebLogic.sh was picking the username and password from properties user config files in user's home directory: username-WebLogicConfig.properties, username-WebLogicKey.properties.
If the credentials for weblogic server are changed then new user config files should be created. If these are not created then stopWebLogic.sh will pick up the old credentials and hence fail.
Please refer the following document for information on user configuration files: http://docs.oracle.com/cd/E21764_01/web.1111/e13813/reference.htm#WLSTC430.
Connecting to the server after deleting username-WebLogicConfig.properties, username-WebLogicKey.properties resolves the issue as it forces the script to use the credentials provided by the user while running stopWebLogic.sh.

Solution

1) Create new user config files with the correct credentials as explained in the following document: http://docs.oracle.com/cd/E21764_01/web.1111/e13813/reference.htm#WLSTC430.
Or
2) To force the stopWeblogic.sh script to use credentials provided by the user while running the script follow these steps:
In the stopWeblogic.sh file use the following connect command:

connect(userConfigFile='',userKeyFile='', url='${ADMIN_URL}', adminServerName='${SERVER_NAME}')
instead of:
connect(${userID} ${password} url='${ADMIN_URL}', adminServerName='${SERVER_NAME}')
Hence in the stopWebLogic.sh script replace:
echo "import os" >"shutdown.py"
echo "if os.environ.has_key('wlsUserID'):" >>"shutdown.py"
echo " wlsUserID = os.environ['wlsUserID']" >>"shutdown.py"
echo "if os.environ.has_key('wlsPassword'):" >>"shutdown.py"
echo " wlsPassword = os.environ['wlsPassword']" >>"shutdown.py"
echo "connect(${userID} ${password} url='${ADMIN_URL}', adminServerName='${SERVER_NAME}')" >>"shutdown.py"
echo "shutdown('${SERVER_NAME}','Server')" >>"shutdown.py"
echo "exit()" >>"shutdown.py"
with:
echo "import os" >"shutdown.py"
echo "if os.environ.has_key('wlsUserID'):" >>"shutdown.py"
echo "  wlsUserID = os.environ['wlsUserID']" >>"shutdown.py"
echo "if os.environ.has_key('wlsPassword'):" >>"shutdown.py"
echo "  wlsPassword = os.environ['wlsPassword']" >>"shutdown.py"
echo "connect(userConfigFile='',userKeyFile='', url='${ADMIN_URL}', adminServerName='${SERVER_NAME}')" >>"shutdown.py"
echo "shutdown('${SERVER_NAME}','Server')" >>"shutdown.py"
echo "exit()" >>"shutdown.py"

0 Comments