Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

noClassDefFoundError

 
Pradyut Bhattacharya
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i have jdk5 installed in win xp sp2
when i do java <filename>
i get the error on my machine
Exception in thread "main" java.lang.NoClassDefFoundError: <filename>
i correct it by doing
java -cp . <filename>
then it runs fine.

but on running a client ejb program on the command line
AppClient -client <filename>
i again get the error
WARNING: ACC003: Application threw an exception.
java.lang.NoClassDefFoundError: converter.ConverterHome
where converter.ConverterHome is contained in the jar file

i do not get a solution to this problem
how can i correct the above problem or the overall problem such that
when i give the command
java <filename>
i get the output simply
any helps
Pradyut
 
Nigel Browne
Ranch Hand
Posts: 703
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to set your classpath to point to the directory your class files are stored and also you will need to add each jar file individually to the classpath.
 
Edster Lamb
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I had the exact same problem.
I had to do this ..

cd C:\PROGRA~1\Java\j2eetutorial\examples\src\ejb\converter
set APPCPATH=ConverterAppClient.jar
runclient -client ConverterApp.ear -name ConverterClient -textauth -Dj2eelogin.name=guest -Dj2eelogin.password=guest123

I hope that helps.
Cheers
Edster
===========================
Sydney Holiday Accommodation - Sydney Apartments
http://sydneyholidayaccommodation.com
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic