I opened a cmd window at this location:
C:\...\apache-jmeter-2.13\lib\ext and ran this command C:\...\apache-jmeter-2.13\lib\ext>java -jar cmdrunner-2.0.jar --tool Reporter --generate-png test.png --input-jtl C:\...\...\Desktop\jmeter\..\reports\
jpGCgraphs.jtl --plugin-type ResponseTimesOverTimeGui --width 800 --height 600
Error:
ERROR: java.lang.IllegalArgumentException: Tool class Reporter not found
*** Problem's technical details go below ***
Home directory was detected as: E:\dumps\apache-jmeter-2.13\lib\ext
Exception in thread "main" java.lang.IllegalArgumentException: Tool class Reporter not found
at kg.apc.cmdtools.PluginsCMD.getToolInstance(PluginsCMD.java:123)
at kg.apc.cmdtools.PluginsCMD.processParams(PluginsCMD.java:53)
at kg.apc.cmdtools.PluginsCMD.processParams(PluginsCMD.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at kg.apc.cmd.UniversalRunner.main(UniversalRunner.java:105)
I am referring to solution here: http://jmeter.512774.n5.nabble.com/Unable-to-execute-JMeterPluginsCMD-Command-Line-Tool-td5681583.html
I have both required jars in the folder: cmdrunner-2.0.jar and JMeterPlugins-Extras.jar
Make sure you have jmeter-plugins-standard.jar in E:\dumps\apache-jmeter-2.13\lib\ext folder
In my case the problem was solved after I installed 'Command-Line Graph Plotting Tool' using plugins manager.
In your question, you refer to: JMeterPlugins-Extras.jar, but the reporter class is found in JMeterPlugins-Standard.jar
The JMeterPlugins-Standard.jar is found in this zip file:
https://jmeter-plugins.org/downloads/file/JMeterPlugins-Standard-1.4.0.zip
Also, it doesn't matter where the jar files are, the jar files must be in class path where you execute the command
hence it requires additional argument
windows
-cp "cmdrunner-2.0.jar;JMeterPlugins-Standard.jar"
Linux
-cp "cmdrunner-2.0.jar:JMeterPlugins-Standard.jar"
Also in the post they are saying they have added jmeter home also added to class path but here i dont see that
hence -cp "C:/pathto/jmeter/home/bin/*.*;cmdrunner-2.0.jar;JMeterPlugins-Standard.jar"
The error message is saying "main" java.lang.IllegalArgumentException: Tool class Reporter not found, means the The class in not found in the class path.
Now the overall command looks
C:\...\apache-jmeter-2.13\lib\ext>java -jar cmdrunner-2.0.jar --tool Reporter --generate-png test.png --input-jtl C:\...\...\Desktop\jmeter\..\reports\
jpGCgraphs.jtl --plugin-type ResponseTimesOverTimeGui --width 800 --height 600 -cp "cmdrunner-2.0.jar;JMeterPlugins-Standard.jar"
Hope this helps .. Please provide your findings . if this helps dont forget to click answered.
Related
Problem explanation
I have recently been trying to use Apache Jena with Java (rather than on the command line). I wrote a simple script to convert read and write differetn RDF format types, as so
import org.apache.jena.riot.RDFDataMgr;
import org.apache.jena.query.Dataset;
import org.apache.jena.riot.Lang;
public class Go_NT
{
public static void main(String[] args)
{
Dataset dataset = RDFDataMgr.loadDataset("triail.nq");
RDFDataMgr.write(System.out, dataset, Lang.NTRIPLES);
}
}
triail.nq is a test nquads file containing 81 quads.
I invoked it as so:
javac -cp "/mnt/e/Tráchtas/apache-jena-3.17.0/lib/*" Go_NT.java
java Go_NT
It compiles without error, but when I run it, it returns an error
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/jena/riot/RDFDataMgr
at Go_NT.main(Go_NT.java:9)
Caused by: java.lang.ClassNotFoundException: org.apache.jena.riot.RDFDataMgr
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 1 more
What I have tried
I have looked around and seen that this error occurs almost always because a necessary .jar file is not included, so a class referenced by the code cannot be loaded. The solution to these other issues was to include all of /apache-jena-3.17.0/lib/* . Oddly enough, that has not worked for me--I do include all of the contents of lib/ in my classpath, but I am still seeing the error.
System notes
I am running Jena 3.17.0, using the default Linux binaries available here (https://jena.apache.org/download/index.cgi). I have not added or removed any other Jena modules.
I am running this in the Windows Subsystem for Linux (version 2) with Ubuntu 20.04.
If any of you have any insight into what could be causing this, I would greatly appreciate it!
Based on the comment by vvs, the link https://howtodoinjava.com/java-examples/set-classpath-command-line/ helped out a lot. There were 2 issues: I needed to include the classpath in the java command, not just javac. I also needed to include the current directory where the output of javac would be.
I fixed this by setting the CLASSPATH variable, and then adding all the needed directories to that. (You could also do this by adding the classpath into the -cp argument). Note that the : separates different directories.
In short, here is what I did:
export CLASSPATH=/mnt/e/Tráchtas/apache-jena-3.17.0/lib/*:.
javac Go_NT.java
java Go_NT
Note that you need to re-assign CLASSPATH each time you open a new terminal.
I have successfully compiled the JNI based Apache libhdfs (C++) on my Hadoop Sandbox / CentOS - no compilation errors or warnings:
g++ test.cpp -o test -I/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.151.x86_64/include/
-I/usr/hdp/2.6.3.0-235/usr/include/ -I/usr/hdp/2.6.3.0-235/hadoop/bin
-I/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.el6_9.x86_64/include/
-I/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.el6_9.x86_64/jre/lib/amd64/
-L/usr/hdp/2.6.3.0-235/hadoop/lib/ -L/usr/hdp/2.6.3.0-235/hadoop/lib/native
-L/usr/hdp/2.6.3.0-235/hadoop/lib/ -L/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.el6_9.x86_64/jre/lib/amd64/
-L/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.el6_9.x86_64/jre/lib/amd64/server/
-lhdfs -pthread -ljvm
Once I try to run the code, I get the following errors:
[root#sandbox-hdp ~]# ./test
Environment variable CLASSPATH not set!
getJNIEnv: getGlobalJNIEnv failed
Environment variable CLASSPATH not set!
getJNIEnv: getGlobalJNIEnv failed
If I run hadoop classpath in the terminal, I get the following output:
[root#sandbox-hdp ~]# hadoop classpath
/usr/hdp/2.6.3.0-235/hadoop/conf:/usr/hdp/2.6.3.0-
235/hadoop/lib/:/usr/hdp/2.6.3.0-235/hadoop/.//:/usr/hdp/2.6.3.0-235/hadoop-
hdfs/./:/usr/hdp/2.6.3.0-235/hadoop-hdfs/lib/:/usr/hdp/2.6.3.0-235/hadoop-
hdfs/.//:/usr/hdp/2.6.3.0-235/hadoop-yarn/lib/:/usr/hdp/2.6.3.0-235/hadoop-
yarn/.//:/usr/hdp/2.6.3.0-235/hadoop-mapreduce/lib/:/usr/hdp/2.6.3.0-
235/hadoop-mapreduce/.//::jdbc-mysql.jar:mysql-connector-java-
5.1.17.jar:mysql-connector-java-5.1.37.jar:mysql-connector-
java.jar:/usr/hdp/2.6.3.0-235/tez/:/usr/hdp/2.6.3.0-
235/tez/lib/:/usr/hdp/2.6.3.0-235/tez/conf
On the Apache libhdfs page it says:
The most common problem is the CLASSPATH is not set properly when
calling a program that uses libhdfs. Make sure you set it to all the
Hadoop jars needed to run Hadoop itself as well as the right
configuration directory containing hdfs-site.xml. It is not valid to
use wildcard syntax for specifying multiple jars. It may be useful to
run hadoop classpath --glob or hadoop classpath --jar to generate the
correct classpath for your deployment. See Hadoop Commands Reference
for more information on this command.
I do however not get how to proceed after many trial and error attempts, I would therefore appreciate any help that could help me to solve this problem.
Edit: tried the following: CLASSPATH=hadoop classpath ./test
...which gave me the following error: libjvm.so: cannot open shared object file: No such file or directory
I tried the following: export LD_LIBRARY_PATH=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.151-1.b12.el6_9.x86_64/jre/lib/amd64/server
...and now the error is:
[root#sandbox-hdp ~]# CLASSPATH=$CLASSPATH:`hadoop classpath` ./test
loadFileSystems error:
(unable to get stack trace for java.lang.NoClassDefFoundError exception: ExceptionUtils::getStackTrace error.)
hdfsBuilderConnect(forceNewInstance=0, nn=default, port=0, kerbTicketCachePath=(NULL), userName=(NULL)) error:
(unable to get stack trace for java.lang.NoClassDefFoundError exception: ExceptionUtils::getStackTrace error.)
hdfsOpenFile(/tmp/testfile.txt): constructNewObjectOfPath error:
(unable to get stack trace for java.lang.NoClassDefFoundError exception: ExceptionUtils::getStackTrace error.)
Maybe the following could works for you:
CLASSPATH=$CLASSPATH:`hadoop classpath` ./test
or only this:
CLASSPATH=`hadoop classpath` ./test
Check out JAVA_HOME environment variable, maybe it could alter the java libraries used too.
And finally, a wrapper like the script below could be useful:
#!/bin/bash
export CLASSPATH="AllTheJARs"
ARG0="$0"
EXEC_PATH="$( dirname "$ARG0" )"
"${EXEC_PATH}/test" $#
I am running java 1.8.0_65 on Windows 7.
I create a JAR and run it with the following command:
java -jar printxml.jar
And get this error:
Error: Could not find or load main class printxml.PrintXml
Here is my command to create the JAR:
jar cmfev manifest.txt printxml.jar printxml.PrintXml #filelist.txt
Contents of file "manifest.txt":
Class-Path: C:\Users\Me\SQLSER~1\JDBC\jtds-1.3.1.jar
I checked whether printxml.PrintXml class is in the JAR via this command:
jar tvf printxml.jar printxml/PrintXml.class
The command succeeded, i.e. PrintXml class is in the JAR.
I then checked if the PrintXml class in the JAR has a "main" method via this command:
javap -classpath printxml.jar -public printxml.PrintXml
The command succeeded and its output included...
public static void main(java.lang.String[]);
Searching the Internet, I found only the obvious answers, like:
Your classpath is wrong.
Your class doesn't have a "main" method.
Can someone please tell me how to resolve this problem?
Thanks,
Avi.
As Homer Simpson would say: D'OH
The value of the Class-Path entry in file "manifest.txt" is wrong!
It needs to be a URL!
So I changed it to:
file:/C:/Users/Me/SQLSER~1/JDBC/jtds-1.3.1.jar
Hey presto! No more error message. Now it runs!
Thanks to all who helped. ;-)
Hi I have a batch file which basically updates some table in the database by running the job.
Here is a batch file code:
set CLASSPATH=C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\selenium-server-standalone-2.32.0.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\jsoup-1.7.2.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\xstream-1.1.3.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\XmlSchema-1.4.7.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\axis2-transport-http-1.6.1.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\log4j-1.2.17.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\mysql-connector-java-5.1.13.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\httpclient-4.1.2.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\httpcore-4.1.2.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\commons-httpclient-3.0.1.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\gson-1.6.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\lucene-core-3.3.0.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\axis2-adb-1.6.1.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\axiom-api-1.2.12.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\axis2-kernel-1.6.1.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\wsdl4j-1.6.2.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\XmlSchema-1.4.7.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\axiom-impl-1.2.12.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\neethi-3.0.1.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\freemarker.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\smtp.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\axis2-transport-local-1.6.1.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\axis2-transport-http-1.6.1.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\mailapi.jar;
C:\ProjectWorkSpace\myProject\web\WEB-INF\classes;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\spring-context-3.1.0.RELEASE.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\spring-core-3.1.0.RELEASE.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\spring-beans-3.1.0.RELEASE.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\spring-asm-3.1.0.RELEASE.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\spring-aop-3.1.0.RELEASE.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\spring-tx-3.1.0.RELEASE.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\aopalliance-1.0.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\spring-expression-3.1.0.RELEASE.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\spring-orm-3.1.1.RELEASE.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\transactions-jdbc-3.8.0.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\transactions-osgi-3.8.0.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\hibernate-3.2.1.ga.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\hibernate-jpa-2.0-api-1.0.1.Final.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\hibernate-annotations-3.2.0.ga.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\jboss-transaction-api_1.1_spec-1.0.0.Final.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\spring-jdbc-3.1.0.RELEASE.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\dom4j-1.6.1.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\transactions-hibernate3-3.8.0.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\gdata-core-1.0.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\xstream-1.1.3.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\commons-lang-2.3.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\xmlunit-1.5.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\log4j-1.2.17.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\axis2-transport-http-1.6.1.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\mailapi.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\antlr-2.7.7.jar;
C:\ProjectWorkSpace\myProject\web\WEB-INF\classes;
java -Xmx1024m -XX:MaxPermSize=512m -XX:ReservedCodeCacheSize=128m com.myProject.batch.PropertyRatesUpdaterBatchJob
I am trying to run the batch file from command prompt but I am getting error like
C:\ProjectWorkSpace\myProject\tools>C:\ProjectWorkSpace\myProject\web\WEB-INF\classes;
'C:\ProjectWorkSpace\myProject\web\WEB-INF\classes' is not recognized as an internal or external command,
operable program or batch file.
and the second error at the end I am getting as
Exception in thread "main" java.lang.NoClassDefFoundError: com/myProject/batch /PropertyRatesUpdaterBatchJob
Caused by: java.lang.ClassNotFoundException: com.myProject.batch.PropertyRatesUpdaterBatchJob
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
and I am not able to run the batch file.
Anybody can help me to how to run the same and what this error mean.
Hi here is my new batch file:
set CLASSPATH=C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\selenium-server-standalone-2.32.0.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\jsoup-1.7.2.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\xstream-1.1.3.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\XmlSchema-1.4.7.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\axis2-transport-http-1.6.1.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\log4j-1.2.17.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\mysql-connector-java-5.1.13.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\httpclient-4.1.2.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\httpcore-4.1.2.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\commons-httpclient-3.0.1.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\gson-1.6.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\lucene-core-3.3.0.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\axis2-adb-1.6.1.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\axiom-api-1.2.12.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\axis2-kernel-1.6.1.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\wsdl4j-1.6.2.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\XmlSchema-1.4.7.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\axiom-impl-1.2.12.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\neethi-3.0.1.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\freemarker.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\smtp.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\axis2-transport-local-1.6.1.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\axis2-transport-http-1.6.1.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\mailapi.jar;C:\ProjectWorkSpace\zaranga\WEB-INF\classes;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\spring-context-3.1.0.RELEASE.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\spring-core-3.1.0.RELEASE.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\spring-beans-3.1.0.RELEASE.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\spring-asm-3.1.0.RELEASE.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\spring-aop-3.1.0.RELEASE.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\spring-tx-3.1.0.RELEASE.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\aopalliance-1.0.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\spring-expression-3.1.0.RELEASE.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\spring-orm-3.1.1.RELEASE.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\transactions-jdbc-3.8.0.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\transactions-osgi-3.8.0.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\hibernate-3.2.1.ga.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\hibernate-jpa-2.0-api-1.0.1.Final.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\hibernate-annotations-3.2.0.ga.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\jboss-transaction-api_1.1_spec-1.0.0.Final.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\spring-jdbc-3.1.0.RELEASE.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\dom4j-1.6.1.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\transactions-hibernate3-3.8.0.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\gdata-core-1.0.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\xstream-1.1.3.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\commons-lang-2.3.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\xmlunit-1.5.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\log4j-1.2.17.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\axis2-transport-http-1.6.1.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\mailapi.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\lib\antlr-2.7.7.jar;C:\ProjectWorkSpace\zaranga\build\zaranga\WEB-INF\classes
java -Xmx1024m -XX:MaxPermSize=512m -XX:ReservedCodeCacheSize=128m com.zaranga.batch.PropertyRatesUpdaterBatchJob
Now I am getting a new error log4j as
Error is :
No org.slf4j.impl.StaticLoggerBinder found in ClassPath, trying with log4j...
Any help will be greatly appriciated.
I assume with
set CLASSPATH=C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\selenium-server-standalone-2.32.0.jar;
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\jsoup-1.7.2.jar;
You wanted to also add jsoup-1.7.2.jar; to the CLASSPATH variable, but you can't just extend a command over multiple lines like that.
If you want to write this on multiple lines, each line (except for the last one of course) must end with the so called "line continuation character" which tells Windows that the command (in your case the SET) isn't finished yet, even though the line is. This character is ^ in Windows (comparable to the \ in Linux/Unix shell scripts)
So what you need is:
set CLASSPATH=C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\selenium-server-standalone-2.32.0.jar; ^
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\jsoup-1.7.2.jar; ^
C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\xstream-1.1.3.jar; ^
.... ^
.... ^
C:\ProjectWorkSpace\myProject\web\WEB-INF\classes;
java -Xmx1024m -XX:MaxPermSize=512m -XX:ReservedCodeCacheSize=128m com.myProject.batch.PropertyRatesUpdaterBatchJob
(btw: you have C:\ProjectWorkSpace\myProject\web\WEB-INF\classes twice in your list)
You must make sure that there is no whitespace whatsoever after the ^ otherwise this will not work.
Btw: you shouldn't be using the CLASSPATH variable anymore. It's better to explicitly define a classpath using the -cp (or -classpath parameter for the java command).
In recent (up-to-date) versions of Java for Windows you don't need to specify each element in the classpath variable.
Quote from http://docs.oracle.com/javase/7/docs/technotes/tools/windows/java.html
As a special convenience, a class path element that contains a base name of * is considered equivalent to specifying a list of all the files in the directory with the extension .jar or .JAR
So you can get rid of all the lines and just use:
java -cp C:\ProjectWorkSpace\myProject\build\myProject\WEB-INF\lib\*;C:\ProjectWorkSpace\myProject\web\WEB-INF\classes com.myProject.batch.PropertyRatesUpdaterBatchJob
I am trying to use randoop(automatic test generator for Java) and randoop cannot find my class:
eliezer#ubuntu:~/Desktop$ java -ea -classpath \
randoop.1.3.2.jar:home/eliezer/myclasses \
randoop.main.Main gentests \
--testclass=/home/eliezer/Desktop/myclasses/ArrayListError
policy = sun.security.provider.PolicyFile#85af80
Throwable thrown while handling command:java.lang.Error:\
classForName(/home/eliezer/Desktop/myclasses/ArrayListError)
java.lang.Error: classForName(/home/eliezer/Desktop/myclasses/ArrayListError)
at randoop.util.Reflection.classForName(Reflection.java:206)
at randoop.util.Reflection.loadClassesFromList(Reflection.java:386)
at randoop.main.GenInputsAbstract.findClassesFromArgs(GenInputsAbstract.java:507)
at randoop.main.GenTests.handle(GenTests.java:184)
at randoop.main.Main.nonStaticMain(Main.java:80)
at randoop.main.Main.main(Main.java:42)
Caused by: java.lang.ClassNotFoundException: \
/home/eliezer/Desktop/myclasses/ArrayListError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at randoop.util.Reflection.classForName(Reflection.java:198)
... 5 more
Randoop failed.
Last sequence under execution:null
My class is called ArrayListError.java and is found in /home/eliezer/Desktop/myclasses.
The randoop docs are found at: https://randoop.github.io/randoop/manual/index.html.
I am sure it is something really trivial but I'm inexperienced with these things.
You need to set your classpath such that, jvm should be able to locate all your resources like classes, files, jars etc.
In your case, ArrayListError is placed under directory /home/eliezer/Desktop/myclasses. You need to place this in your classpath.
Once you point your classpath to mentioned directory, You need to pass the class name to --testclass=ArrayListError.
java -ea -classpath randoop.1.3.2.jar:/home/eliezer/Desktop/myclasses randoop.main.Main gentests --testclass=ArrayListError
should fix your problem. I suggest you to search on setting classpath and read on.
This is wrong
my class is called ArrayListError.java and is found in
/home/eliezer/Desktop/myclasses.
Your ArrayListError.java is the source code, but java virtual machine needs a compiled class in its classpath.
EDIT:
Since you said that you have the .class file also, then your problem can be solved in two ways
a. No package
Run the command (take care of the --testclas, it is not directory, it should be the class)
java -ea -classpath randoop.1.3.2.jar:/home/eliezer/myclasses
randoop.main.Main gentests --testclass=ArrayListError
b. Class in a package
If your ArrayListError does have package com.test; make a directory /com/test in your myclasses directory and run the command below
java -ea -classpath
randoop.1.3.2.jar:/home/eliezer/myclasses/com/test/ randoop.main.Main
gentests --testclass=com.test.ArrayListError
Check your classpath on the command line;
I see home/eliezer/myclasses, without the leading /.