6

On Eclipse Galileo, got the following ClassNotFoundException when doing Debug As/Web Application. But works just fine when doing Run As/Web Application.

I was given message that "The source attachment does not contain the source for the file URLClassLoader.class. You can change the source attachment by clicking the Change Attached Source below:"

In the project window, it seems that the URLClassLoader class is from Java.net package, which is from /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Classes/classes.jar.

I found the jar on the machine, what else I am missing? why it's debug only issue?

Could it be possible that the JRE system library that I have on my iMac 10.6.5 machine is outdated? Or somehow install/unstall of some jar/package caused the issue?

This is what I have - JRE System Library [JVM 1.6.0 (MacOS X Default)] - would update it help fixing the issue? but how to get it updated?

Please help!

com.google.appengine.tools.development.DevAppServerMain at localhost:57873 
 Thread [main] (Suspended (exception ClassNotFoundException)) 
  Launcher$ExtClassLoader(URLClassLoader).findClass(String) line: 207 
  Launcher$ExtClassLoader.findClass(String) line: 229 
  Launcher$ExtClassLoader(ClassLoader).loadClass(String, boolean) line: 307 
  Launcher$AppClassLoader(ClassLoader).loadClass(String, boolean) line: 296 
  Launcher$AppClassLoader.loadClass(String, boolean) line: 301 
  Launcher$AppClassLoader(ClassLoader).loadClass(String) line: 248 
  InstrumentationImpl.loadClassAndStartAgent(String, String, String) line: 280 
  InstrumentationImpl.loadClassAndCallPremain(String, String) line: 338 
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin/java (Nov 30, 2010 9:40:41 PM) 
RAS
  • 8,100
  • 16
  • 64
  • 86
tom
  • 14,273
  • 19
  • 65
  • 124
  • it seems that really there is something wrong with the Java SDK/JRE installed on my iMac machine, I even got the similar error when doing 'Java -version' from inside Terminal, see the following - – tom Dec 01 '10 at 07:22
  • tom$ Java –version Exception in thread "main" java.lang.NoClassDefFoundError: ?version Caused by: java.lang.ClassNotFoundException: ?version at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) – tom Dec 01 '10 at 07:23
  • for some reason, the above error in the Terminal is gone. But the error inside the Eclipse is still there :-(, anyone please help! – tom Dec 01 '10 at 08:12

1 Answers1

0

Perhaps you need to install JDK which has complete sources? Refer to Apple website to download the latest JDK, might need an Apple ID.

After that change eclipse's java runtime accordingly to use the new installed JDK:

enter image description here

And re-build your project: Project -> Source -> Clean-up