Archive

Posts Tagged ‘WLST’

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

Advertisement
Categories: WebLogic Tags: ,