Archive

Posts Tagged ‘WebLogic’

Unable to start WLST: “Problem invoking WLST – Traceback (most recent call last)”

The above error means that the correct CLASSPATH has not been set in order to start WLST because of environment not being properly set. The same error can occur for other utilities such as weblogic.Deployer, utils.dbping or even weblogic.Server etc. I was using this decrypt weblogic admin password.

Exact Error was as below

$ java weblogic.WLST

Initializing WebLogic Scripting Tool (WLST) ...

Problem invoking WLST - Traceback (most recent call last):
  File "/tmp/WLSTOfflineIni7376338350886613784.py", line 3, in <module>
    import os
ImportError: No module named os

-bash-4.1$

The root cause is always the same, Correct environment not being properly Set and hence the required classes are not loaded.
To fix this, set your environment explicitly using

1. Make sure the right environment is set by running the setWLSEnv.sh script. This is located under @MW_HOME/wlserver/server/bin

The setWLSEnv.sh script needs to be sourced in order to execute the script in the context of the running shell, and have the actual environment of the shell be set. It has to be executed as either ” ./setWLSEnv.sh” (notice the extra dot) or “source ./setWLSEnv.sh” and then the CLASSPATH can be confirmed in the current shell with the “env” command.

Simply executing the script “./setWLSEnv.sh” will only display the output on the screen.

Once the environment is set, I was able to run the java weblogic.WLST successfully

-bash-4.1$ . ./setWLSEnv.sh
CLASSPATH=/xxxxxx/fmw/jdk1.7.0_51/lib/tools.jar:/xxxxxx/fmw/product/12/wlserver/server/lib/weblogic_sp.jar:/xxxxxx/fmw/product/12/wlserver/server/lib/weblogic.jar:/xxxxxx/fmw/product/12/wlserver/server/webservices.jar:/xxxxxx/fmw/product/12/oracle_common/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/xxxxxx/fmw/product/12/oracle_common/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar:/xxxxxx/product/12/wlserver/modules/features/oracle.wls.common.nodemanager_1.0.0.0.jar:

PATH=/xxxxxx/fmw/product/12/wlserver/server/bin:/xxxxxx/fmw/product/12/oracle_common/modules/org.apache.ant_1.7.1/bin:/xxxxxx/fmw/jdk1.7.0_51/jre/bin:/xxxxxx/fmw/jdk1.7.0_51/bin:/xxxxxx/fmw/jdk1.7.0_51//usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/xxxxxx/fmw/product/12/oracle_common/modules/org.apache.maven_3.0.4/bin

Your environment has been set.
-bash-4.1$ java weblogic.WLST

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

wls:/offline>

Hope this helps.
-Anand M

Advertisements
Categories: WebLogic Tags: ,

Decrypt weblogic admin password

November 22, 2016 Leave a comment

Pls follow below steps to decrypt Weblogic admin password

Step 1:- Create a file called – decryptPass.py and udpate the file with below cotents


import os
import weblogic.security.internal.SerializedSystemIni
import weblogic.security.internal.encryption.ClearOrEncryptedService

def decrypt(domainHomeName, encryptedPwd):
domainHomeAbsolutePath = os.path.abspath(domainHomeName)
encryptionService = weblogic.security.internal.SerializedSystemIni.getEncryptionService(domainHomeAbsolutePath)
ces = weblogic.security.internal.encryption.ClearOrEncryptedService(encryptionService)
clear = ces.decrypt(encryptedPwd)
print "RESULT:" + clear

try:
if len(sys.argv) == 3:
decrypt(sys.argv[1], sys.argv[2])
else:
print "INVALID ARGUMENTS"
print " Usage: java weblogic.WLST decryptPassword.py DOMAIN_HOME ENCRYPTED_PASSWORD"
print " Example:"
print " java weblogic.WLST decryptPassword.py D:/Oracle/Middleware/user_projects/domains/base_domain {AES}819R5h3JUS9fAcPmF58p9Wb3syTJxFl0t8NInD/ykkE="
except:
print "Unexpected error: ", sys.exc_info()[0]
dumpStack()
raise

Step 2:- Set Domain environment variable

cd $FMW_HOME/user_projects/domains/<domain_name>


. setDomainEnv.sh

Once it is properly set, do echo $DOMAIN_HOME and you will find it getting properly displayed

Step 3:- Get encrypted password value from boot.properties file


$ grep password $DOMAIN_HOME/servers/AdminServer/security/boot.properties | sed -e "s/^password=\(.*\)/\1/"

{AES}udb6nZLDw24HiRRrZkojuoiLNiu/MfAIZpcU=

Step 4:- Decrypt the encrypted password obtained in Step 3 (Run the command from the location where the decryptPass.py is kept)


java weblogic.WLST decryptPass.py $DOMAIN_HOME {AES}udb6nZLDw24HiRRrZkojuoiLNiu/MfAIZpcU=

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

RESULT:r41cOWqpc

Hope this helps. Happy reading!

-Anand M