Hi friends, My application is so simple and it was working before I just rename the program and now when I want to run the program again, it gives me Exception in thread "main" and I can not figure out why? I didn't change any thing... Hope to hear from you guys so soon. Elahe [error] java.lang.NoClassDefFoundError: WEB-INF/classes/com/srs/bugtrack/DateTransfer (wrong name: com/srs/bugtrack/DateTransfer) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:486) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111) at java.net.URLClassLoader.defineClass(URLClassLoader.java:248) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:297) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286) at java.lang.ClassLoader.loadClass(ClassLoader.java:253) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313) Exception in thread "main"
This error is becuase the JVM cannot find the class that you say to look for. Which is either a niming issue or a classpath issue. classpath because it doesn't know where to look correctly, or naming because it is looking for one name, but you have it as a different name. That's the best I can do for you. Hope it helps. Mark
As explained by Mark, your renaming the file means that you have a class file with the old name and a file called something else. Bottom line, the class name containing the main method and the file name must match.
Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
just checking, did you re-compile the program under the new name? If not, you don't have a class file with the new name for the JVM to find! again, I'm just checking. Jamie [I think this is what Bosun was implying too] [ May 21, 2002: Message edited by: Jamie Robertson ]