java.lang.NoClassDefFoundError when launching application
After getting an application to run successfully very frequently I try to run it again and I get something like the following:
java.lang.NoClassDefFoundError: Parallel
Caused by: java.lang.ClassNotFoundException: Parallel
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)
Exception in thread "main"
I have made no changes to the source code or any other configuration - the problem spontaneously happens.
Sometimes you can clear the problem by editing the source and re-saving. Sometimes this does not work and you have to create a new source file and copy the old source in.
This same problem plagued earlier versions of Scala too.
This is really annoying and erodes confidence that Eclipse is a practical tool for Scala software development.
java.lang.NoClassDefFoundError: Parallel
Caused by: java.lang.ClassNotFoundException: Parallel
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)
Exception in thread "main"
I have made no changes to the source code or any other configuration - the problem spontaneously happens.
Sometimes you can clear the problem by editing the source and re-saving. Sometimes this does not work and you have to create a new source file and copy the old source in.
This same problem plagued earlier versions of Scala too.
This is really annoying and erodes confidence that Eclipse is a practical tool for Scala software development.
Leave a comment
on 2010-07-27 22:44 *
By
Is there a class Parallel on the classpath of your application?
Basically Parallel.class is in the bin directory of the project, in the default package. Technically in the run configuration the classpath contains the default classpath. Right now everything runs properly, but the next time the problem happens I'll take a closer look at my run configuration to see if anything changes. This is one of those nasty indeterminate glitches. I don't know how to force the problem to happen.
As an aside I have also noticed similar problems when using the JavaFX plug-in. On the other hand, I've never had this problem happen to any Java application.
As an aside I have also noticed similar problems when using the JavaFX plug-in. On the other hand, I've never had this problem happen to any Java application.
The last time this happened, did you check that there was a Parallel.class in the bin directory? There have been issues with types in the default package in the past ... as far as I'm aware they've all been fixed, but it's conceivable that that could be contributing to the problem ... have you tried moving Parallel to a non-default package?
No, I did not think to check the bin directory the last time the problem happened - but I will do so if/when it happens again.
I do a lot of playing around in the default package, basically to test ideas and better learn Scala. It probably makes sense for me to continue to do so - in case the problem happens again I will know what to look for and can report back to this issue.
I have other code that is not in the default package. I cannot recall if I have had any problems with those programs.
I do a lot of playing around in the default package, basically to test ideas and better learn Scala. It probably makes sense for me to continue to do so - in case the problem happens again I will know what to look for and can report back to this issue.
I have other code that is not in the default package. I cannot recall if I have had any problems with those programs.
on 2010-07-28 05:36 *
By David Bernard
[OT]
for try/test code I used package named sandbox or sandbox_xxxx
for try/test code I used package named sandbox or sandbox_xxxx
Updating tickets (#3255, #3262, #3271, #3277, #3279, #3287, #3313, #3317, #3318, #3320, #3329, #1000000, #1000002, #1000004, #1000005, #1000007, #1000011, #1000013, #1000018, #1000019, #1000020, #1000022, #1000023, #1000024, #1000025, #1000026, #1000028, #1000031, #1000033, #1000034, #1000037, #1000039, #1000040, #1000041, #1000057, #1000058, #1000060, #1000061, #1000063, #1000064, #1000065, #1000067, #1000070, #1000073, #1000076, #1000080, #1000082, #1000083, #1000084, #1000085, #1000087, #1000088, #1000089, #1000090, #1000092, #1000093, #1000094, #1000095, #1000097, #1000102, #1000104, #1000106, #1000108, #1000110, #1000111, #1000116, #1000124, #1000126, #1000127, #1000129, #1000132, #1000133, #1000136, #1000139, #1000143, #1000144, #1000145, #1000148, #1000149, #1000152, #1000154, #1000155, #1000157, #1000158, #1000159, #1000161, #1000169, #1000170, #1000172, #1000174, #1000176, #1000178, #1000179, #1000183, #1000185, #1000188, #1000189, #1000192, #1000196, #1000198)
Closing old tickets.