Question

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?

Was it helpful?

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.

OTHER TIPS

You don't need to do that every time you run the batch file.

  1. From "My Computer" or "Computer" (depending on your version of Windows)
  2. Click "Properties" or "System Properties"
  3. Click "Advanced System Settings"
  4. Add these user Environment Variables

    WL_HOME=C:/Oracle/Middleware/wlserver_10.3
    

    and

    CLASSPATH=.;%WL_HOME%/server/lib/weblogic.jar
    
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top