Forum: Managing VoltDB

Post: can't start the server - Exception in thread "main" java.lang.NoClassDefFoundError: org/voltdb/VoltDB

can't start the server - Exception in thread "main" java.lang.NoClassDefFoundError: org/voltdb/VoltDB
sandyh88
Dec 9, 2011
I used the voltdb generate script to generate the template application. I have built the application through Eclipse and the build was successful. Now, I want to start the VoltDB database and have the above error. My env:
PATH=/usr/local/jdk1.6.0_12/bin:/opt/java/64/jre1.6.0_16/bin:/usr/bin:/usr/local/bin:/bin:/usr/bin
JAVA_HOME=/usr/local/jdk1.6.0_12
HOME=/home/shung
PYTHONPATH=/usr/local/lib/python2.3/site-packages
LOGNAME=shung
CLASSPATH=/home/shung/PROJECT/mytest:/opt/voltdb/voltdb/voltdb*
My project:

pwd: /home/shung/PROJECT/mytest
--->
shung@voltdbdev001.shopzilla.laxhq (0.00)$ ls
build.xml catalog.jar debugoutput deployment.xml mytest-ddl.sql obj project.xml src
My VoltDB installation:
pwd: /opt/voltdb/voltdb
--->
shung@voltdbdev001.shopzilla.laxhq (0.01)$ ls
libvoltdb-2.1.2.so license.xml log4j.properties log4j.xml voltdb-2.1.2.jar voltdbclient-2.1.2.jar
I use the command to start the DB. What am I missing? Thanks for your help.
--->
shung@voltdbdev001.shopzilla.laxhq (0.06)$ java -Djava.library.path=/opt/voltdb/voltdb org.voltdb.VoltDB \
> leader voltdbdev001.shopzilla.laxhq \
> catalog catalog.jar \
> deployment deployment.xml
Exception in thread "main" java.lang.NoClassDefFoundError:

org/voltdb/VoltDB
Caused by: java.lang.ClassNotFoundException: org.voltdb.VoltDB
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:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: org.voltdb.VoltDB. Program will exit.
Is looks like the VoltDB jar
aweisberg
Dec 9, 2011
Is looks like the VoltDB jar isn't in your CLASSPATH environment variable. What is the output of 'echo $CLASSPATH'? I went a test the generate script and the generated skeleton and build.xml worked to launch a server.

-Ariel
Thanks for your response and
sandyh88
Dec 9, 2011
Is looks like the VoltDB jar isn't in your CLASSPATH environment variable. What is the output of 'echo $CLASSPATH'? I went a test the generate script and the generated skeleton and build.xml worked to launch a server.

-Ariel


Thanks for your response and help.

I just installed another VoltDB under my own home with my own login. I could start example application server:
12/09/11 11:24:25 [ /home/shung/voltdb/examples/voter ]
--->
shung@voltdbdev001.shopzilla.laxhq (0.04)$ ./run.sh
However, I still can't start the test application. The env:
--->
shung@voltdbdev001.shopzilla.laxhq (0.08)$ echo $HOME
/home/shung
12/09/11 11:30:23 [ /home/shung/PROJECT/mytest ]
--->
shung@voltdbdev001.shopzilla.laxhq (0.04)$ echo $CLASSPATH
/home/shung/PROJECT/mytest:/home/shung/voltdb/voltdb/voltdb*
-->
shung@voltdbdev001.shopzilla.laxhq (0.14)$ java -Djava.library.path=$HOME/voltdb/voltdb org.voltdb.VoltDB \
>leader voltdbdev001.shopzilla.laxhq \
>catalog catalog.jar deployment deployment.xml \
>license $HOME/voltdb/voltdb/LICENSE
Exception in thread "main" java.lang.NoClassDefFoundError: org/voltdb/VoltDB
Caused by: java.lang.ClassNotFoundException: org.voltdb.VoltDB
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: org.voltdb.VoltDB. Program will exit.
Hi, Andrew tells me This as a
aweisberg
Dec 9, 2011
Thanks for your response and help.

I just installed another VoltDB under my own home with my own login. I could start example application server:
12/09/11 11:24:25 [ /home/shung/voltdb/examples/voter ]




Hi,

Andrew tells me

This as a classpath won't work:


CLASSPATH=/home/shung/PROJECT/mytest:/opt/voltdb/voltdb/voltdb*

It ought to be
CLASSPATH="/home/shung/PROJECT/mytest:/opt/voltdb/voltdb/*"


Class paths have to end in a directory, a specific file, or "*" to indicate all jar files in the directory. "voltdb*" won't work.

So it looks like the classpath isn't expanding to include the jars.

Ariel
Thanks. I can move forward
sandyh88
Dec 9, 2011
Thanks. I can move forward with the change, but have different set of errors:
--->
shung@voltdbdev001.shopzilla.laxhq

(0.03)$ java -Djava.library.path=$HOME/voltdb/voltdb org.voltdb.VoltDB \
>leader voltdbdev001.shopzilla.laxhq \
>catalog /home/shung/PROJECT/mytest/catalog.jar \
>deployment /home/shung/PROJECT/mytest/deployment.xml \
>license $HOME/voltdb/voltdb/LICENSE
Dec 9, 2011 8:56:22 PM org.voltdb.logging.VoltUtilLoggingLogger l7dlog
INFO: host_VoltDB_StartupString
Dec 9, 2011 8:56:22 PM org.voltdb.logging.VoltUtilLoggingLogger log
INFO: Build: 2.1.2 voltdb-2.1.1-22-gd523860 Enterprise Edition
Dec 9, 2011 8:56:22 PM org.voltdb.logging.VoltUtilLoggingLogger log
INFO: URL of deployment info: /home/shung/PROJECT/mytest/deployment.xml
Dec 9, 2011 8:56:22 PM org.voltdb.logging.VoltUtilLoggingLogger l7dlog
INFO: compiler_VoltCompiler_LeaderAndHostCountAndSitesPerHost : 1, voltdbdev001.shopzilla.laxhq, 2, 0,
Dec 9, 2011 8:56:22 PM org.voltdb.logging.VoltUtilLoggingLogger log
INFO: The entire cluster has 1 copy of each of the 2 logical partitions.
Dec 9, 2011 8:56:22 PM org.voltdb.logging.VoltUtilLoggingLogger log
INFO: Detection of network partitions in the cluster is not enabled.
Dec 9, 2011 8:56:22 PM org.voltdb.logging.VoltUtilLoggingLogger log
INFO: Using "/tmp" for voltdbroot directory.
Dec 9, 2011 8:56:22 PM org.voltdb.logging.VoltUtilLoggingLogger log
INFO: Creating snapshot directory: /tmp/snapshots
Dec 9, 2011 8:56:22 PM org.voltdb.logging.VoltUtilLoggingLogger log
INFO: Creating export overflow directory: /tmp/export_overflow
Dec 9, 2011 8:56:22 PM org.voltdb.logging.VoltUtilLoggingLogger log
INFO: Creating command log directory: /tmp/command_log
Dec 9, 2011 8:56:22 PM org.voltdb.logging.VoltUtilLoggingLogger log
INFO: Creating command log snapshot directory: /tmp/command_log_snapshot
Dec 9, 2011 8:56:23 PM org.voltdb.logging.VoltUtilLoggingLogger log
INFO: URL of deployment info: /home/shung/PROJECT/mytest/deployment.xml
Dec 9, 2011 8:56:23 PM org.voltdb.logging.VoltUtilLoggingLogger log
INFO: Beginning inter-node communication on port 3021.
Dec 9, 2011 8:56:23 PM org.voltdb.logging.VoltUtilLoggingLogger log
INFO: Connecting to VoltDB cluster as the leader...
Dec 9, 2011 8:56:23 PM org.voltdb.logging.VoltUtilLoggingLogger log
INFO: Maximum clock/network skew is 0 milliseconds (according to leader)
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/jetty/server/Connector
at org.voltdb.Inits$StartHTTPServer.run(Inits.java:443)
at org.voltdb.Inits$InitializerWorker.run(Inits.java:104)
at org.voltdb.Inits.doInitializationWork(Inits.java:181)
at org.voltdb.RealVoltDB.initialize(RealVoltDB.java:323)
at org.voltdb.VoltDB.initialize(VoltDB.java:509)
at org.voltdb.VoltDB.main(VoltDB.java:491)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.server.Connector
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 6 more
starting from Eclipse is okay ...
sandyh88
Dec 12, 2011
Thanks. I can move forward with the change, but have different set of errors:
--->
shung@voltdbdev001.shopzilla.laxhq





I am able to start the server and run the client through Eclipse interface. However, I still can't start the server through command line.
Don't forget /lib
ajgent
Dec 12, 2011
Thanks. I can move forward with the change, but have different set of errors:
--->
shung@voltdbdev001.shopzilla.laxhq




Hi,

Looking back at your earlier classpath example, you are including .../voltdb/ but not .../lib/
When starting a server, you must include the JARs from both folders. So your classpath when starting the server should look something like this:
CLASSPATH="/home/shung/PROJECT/mytest:/opt/voltdb/voltdb/*:/opt/voltdb/lib/*"
Sorry for not mentioning that earlier.

--Andrew