Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
KDawg44 - 29 Nov 2007 18:06 GMT
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 .:openchord_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.
Joe Attardi - 29 Nov 2007 18:15 GMT
> java -cp .:openchord_1.0.4.jar:log4j.jar ClientPackage/ChatClient $*

You use a dot to separate packages, so your command should be:
java -cp .:openchord_1.0.4.jar:log4j.jar ClientPackage.ChatClient $*
KDawg44 - 29 Nov 2007 18:22 GMT
> > java -cp .:openchord_1.0.4.jar:log4j.jar ClientPackage/ChatClient $*
>
> You use a dot to separate packages, so your command should be:
> java -cp .:openchord_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 .:openchord_1.0.4.jar:log4j.jar ClientPackage.ChatClient $*
$
KDawg44 - 29 Nov 2007 19:09 GMT
> > > java -cp .:openchord_1.0.4.jar:log4j.jar ClientPackage/ChatClient $*
>
[quoted text clipped - 11 lines]
> java -cp .:openchord_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.
KDawg44 - 29 Nov 2007 19:10 GMT
> > > > java -cp .:openchord_1.0.4.jar:log4j.jar ClientPackage/ChatClient $*
>
[quoted text clipped - 28 lines]
>
> Thanks for any help.

Please disregard.  Typo in the run script.  Sorry to waste your time.
Roedy Green - 30 Nov 2007 11:50 GMT
>NoClassDefFoundError

see
http://mindprod.com/jgloss/runerrormessages.html#NOCLASSDEFFOUNDERROR
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.