How to run WLST in windows? - 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?

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.

You don't need to do that every time you run the batch file.
From "My Computer" or "Computer" (depending on your version of Windows)
Click "Properties" or "System Properties"
Click "Advanced System Settings"
Add these user Environment Variables
WL_HOME=C:/Oracle/Middleware/wlserver_10.3
and
CLASSPATH=.;%WL_HOME%/server/lib/weblogic.jar

Related

Debugging instal4j installer

I've be struggling in debugging an install4j installer where I'm trying to introduce some complicated condition expression that is failing for some reason.
However when I try to use the debug_installer.sh script I get the following error:
java.io.FileNotFoundException: /Applications/install4j/resource/MessagesDefault (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:120)
at com.install4j.runtime.util.FileResourceBundle.<init>(Unknown Source)
at com.install4j.runtime.installer.frontend.Messages.createMessagesInternal(Unknown Source)
at com.install4j.runtime.installer.frontend.Messages.createMessages(Unknown Source)
at com.install4j.runtime.installer.frontend.Messages.getMessages(Unknown Source)
at com.install4j.runtime.installer.frontend.GUIHelper.showMessageInternal(Unknown Source)
at com.install4j.runtime.installer.frontend.GUIHelper.access$100(Unknown Source)
at com.install4j.runtime.installer.frontend.GUIHelper$2.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:682)
at java.awt.EventQueue.access$000(EventQueue.java:85)
at java.awt.EventQueue$1.run(EventQueue.java:643)
at java.awt.EventQueue$1.run(EventQueue.java:641)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:652)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
The file actually doesn't exist but I have no idea of what that file should contain. My install4j version is 4.2.8
In the debug installer start script, replace
-cp i4jruntime.jar:user.jar:user/*.jar
with
-cp 'i4jruntime.jar:user.jar:user/*'
Then it should work. This bug was fixed in 5.0.1.

Run weka classifiers using Windows cmd line

I want to run weka through the command line. I type in this command:
java -classpath weka.jar weka.classifiers.trees.J48 -t data/weather.arff -i
And I get this error
Exception in thread "main" java.lang.NoClassDefFoundError: weka/classifiers/tree
s/J48
Caused by: java.lang.ClassNotFoundException: weka.classifiers.trees.J48
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)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Could not find the main class: weka.classifiers.trees.J48. Program will exit.
My classpath variable is set to C:\Program Files\Weka-3-4\mysql-connector-java-3.1.8-bin.jar
Please let me know. Thanks.
Is your command shell in the same directory as weka.jar?
You get that message if java simply can't find weka.jar
go
dir weka.jar
and check that the command shell can find it.
If not, you need to cd to the folder that contains weka.jar
Or you could put the full path to weka.jar
$java -classpath /"your-weka-path"/weka.jar weka.classifiers.trees.J48 -t data/weather.arff -i

Maven infinispan quickstart

I compiled Infinispan quickstart and when I am trying to run I am getting following error
Exception in thread "main" java.lang.NoClassDefFoundError: Quickstart (wrong nam
e: org/infinispan/quickstart/embeddedcache/Quickstart)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
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: Quickstart. Program will exit.
I am following this tutorial.
https://github.com/infinispan/infinispan-quickstart/tree/master/embedded-cache
Though I am not using any IDE so that I can learn how maven works with infinispan. From command prompt prompt I am using this command To compile,
mvn clean compile dependency:copy-dependencies -DstripVersion
and then, to run,
java -cp target/classes:target/dependency/* Quickstart
It is compiling successfully.
I have tried to compile and then run the quickstart from within target directory where the class file is kept. But I am getting the same error class found .....
Thanks
Meena
Anyhelp will be appreciated.
Try running with
java -cp target/classes:target/dependency/* org.infinispan.quickstart.embeddedcache.Quickstart

Why is WEKA not running from the command line?

I apologize, this seems like it is really simple but I can't seem to get it.
I've downloaded the Windows version of WEKA and installed it, but I can't seem to call it from the command line.
I've added a WEKAHOME environment variable, pointing to the directory containing weka.jar, and added that to my path with /weka.jar appended to it..
I am trying this command: java weka.classifiers.j48.J48 -t %WEKAHOME%/data/iris.arff
I then get the following error output.
Exception in thread "main" java.lang.NoClassDefFoundError:
weka/classifiers/j48/ J48 Caused by: java.lang.ClassNotFoundException:
weka.classifiers.j48.J48
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: weka.classifiers.j48.J48. Program will exit.
What can I do to fix this?
It's because of this weka.classifiers.j48.J48, that is an error in the Weka documentation, it should be: weka.classifiers.trees.J48
(Note: the comments below are no longer relevant. The answer here works, and remember to set the classpath as Thomas Jungblut says below.)

Starting teamcity 6.5 manually results in java.lang.NoClassDefFoundError

I try to start teamcity manually but I get an error:
*Exception in thread "main" java.lang.NoClassDefFoundError: jetbrains/buildServer
/agent/Check*
First I stop the windows service:
C:\>net stop tcbuildagent
The TeamCity Build Agent Service service is stopping..
The TeamCity Build Agent Service service was stopped successfully.
Then I start the agent:
C:\>C:\TeamCity\buildAgent\bin\agent.bat start
Exception in thread "main" java.lang.NoClassDefFoundError: jetbrains/buildServer
/agent/Check
Caused by: java.lang.ClassNotFoundException: jetbrains.buildServer.agent.Check
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: jetbrains.buildServer.agent.Check. Program will
exit.
What is causing this issue?
It looks like your installation is broken, reinstalling TeamCity and the build agent should help.

Resources