Question:
Question on java...?
scottcky1985
2007-08-15 19:45:35 UTC
Exception in thread "main" java.lang.NoClassDefFoundError: AddGuest (wrong name:
com/selectv/cxs/billing/AddGuest)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)

> What does this error means & how to fix it?
Three answers:
Rob C
2007-08-15 20:22:48 UTC
NoClassDefFoundError means that the JVM cannot find the class in the classpath. Most likely, your classpath is missing a jar that you need.
McFate
2007-08-16 04:16:07 UTC
The ClassLoader is looking for a class (in this case com. selectv. cxs. billing. AddGuest) and is unable to load it.



The class must have been present when the code was compiled, otherwise the compile wouldn't have worked, but it is not available when executing.



Your development environment should be able to tell you where that class comes from, and then you should be able to make sure that the relevant .jar is in the classpath.
mdigitale
2007-08-16 02:54:25 UTC
It means you're missing a try{} and catch{} on your handling.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Continue reading on narkive:
Loading...