Search code examples
windowsweblogicwlst

How to run WLST in windows?


I tried to run WLST (on Windows XP) but i always get java.lang.NoClassDefFoundError:

Exception in thread "main" java.lang.NoClassDefFoundError: weblogic/wlst
Caused by: java.lang.ClassNotFoundException: weblogic.wlst
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: weblogic.wlst.  Program will exit.

I tried to run *user_projects/domains/my_domain/bin/setDomainEnv.cmd* and *wlserver_10.3/server/bin/setWLSEnv.cmd* but without any success, i always get this NoClassDefFoundError when i run java weblogic.wlst myscript.py. What should i do?


Solution

  • To invoke WLST:

    <WL_HOME>/common/bin/wlst.cmd myscript.py
    

    Example:

    C:/Oracle/Middleware/wlserver_10.3/common/bin/wlst.cmd myscript.py
    

    The reason for your error is, weblogic.jar is not present in your CLASSPATH environment variable.