Exception in thread "main" java.lang.NoClassDefFoundError:

K

KDawg44

Hi,

I am trying to run my app and am getting this error:
Exception in thread "main" java.lang.NoClassDefFoundError:
ClientPackage/ChatClient

The command I am using is this in a shell script:
java -cp .:eek:penchord_1.0.4.jar:log4j.jar ClientPackage/ChatClient $*

Then I run like this:
$ ./runScript.sh -master name


I have been searching the groups and it seems like the problem is with
the way I am running and not the app itself (?)

I do not really understand what the other posts are saying is wrong.

Everything (all the class files and the run script) is in the exact
same directory, ClientPackage.

Thanks for any help.
 
J

Joe Attardi

KDawg44 said:
java -cp .:eek:penchord_1.0.4.jar:log4j.jar ClientPackage/ChatClient $*

You use a dot to separate packages, so your command should be:
java -cp .:eek:penchord_1.0.4.jar:log4j.jar ClientPackage.ChatClient $*
 
K

KDawg44

You use a dot to separate packages, so your command should be:
java -cp .:eek:penchord_1.0.4.jar:log4j.jar ClientPackage.ChatClient $*

Thank you very much for the reply.

I made the change and am still receiving the same error.

$ ./runScript.sh -master kevin
Exception in thread "main" java.lang.NoClassDefFoundError:
ClientPackage/ChatClient
$ cat runScript.sh
java -cp .:eek:penchord_1.0.4.jar:log4j.jar ClientPackage.ChatClient $*
$
 
K

KDawg44

Thank you very much for the reply.

I made the change and am still receiving the same error.

$ ./runScript.sh -master kevin
Exception in thread "main" java.lang.NoClassDefFoundError:
ClientPackage/ChatClient
$ cat runScript.sh
java -cp .:eek:penchord_1.0.4.jar:log4j.jar ClientPackage.ChatClient $*
$

Okay, I was running the script from within the ClientPackage
directory. Once I moved it out it is running now. However, I am
getting another class not found exception:

$ ./runScript.sh -master kevin
Exception in thread "main" java.lang.NoClassDefFoundError: de/uniba/
wiai/lspi/chord/service/ServiceException
at ClientPackage.ChatClient.<init>(ChatClient.java:26)
at ClientPackage.ChatClient.main(ChatClient.java:115)

This is part of the Chord implementation. Shouldn't this be in the
openchord_1.0.4.jar file? Why is it not finding this? Also, the
lines this is referring to do not have any code at all and are not
using Chord.

Thanks for any help.
 
K

KDawg44

Okay, I was running the script from within the ClientPackage
directory. Once I moved it out it is running now. However, I am
getting another class not found exception:

$ ./runScript.sh -master kevin
Exception in thread "main" java.lang.NoClassDefFoundError: de/uniba/
wiai/lspi/chord/service/ServiceException
at ClientPackage.ChatClient.<init>(ChatClient.java:26)
at ClientPackage.ChatClient.main(ChatClient.java:115)

This is part of the Chord implementation. Shouldn't this be in the
openchord_1.0.4.jar file? Why is it not finding this? Also, the
lines this is referring to do not have any code at all and are not
using Chord.

Thanks for any help.

Please disregard. Typo in the run script. Sorry to waste your time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,708
Latest member
SherleneF1

Latest Threads

Top