Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 67681 - java.lang.NoClassDefFoundError on shutdown
Summary: java.lang.NoClassDefFoundError on shutdown
Status: RESOLVED DUPLICATE of bug 67753
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-17 13:57 EDT by Pascal Rapicault CLA
Modified: 2004-06-24 11:54 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pascal Rapicault CLA 2004-06-17 13:57:08 EDT
In the bug #67369 I mentionned the existence of a NoClassDefFoundError and here
it is. I don't have clear steps to reproduce it but here is how I proceed.
I start eclipse, wait for the UI to come up, wait a second or two. Shutdown.
Of course this is not really precise but I guess that with setting a few
breakpoints this is easily reproduceable.

In the console, I get the following error which is the result of a thread still
running and loading classes while the framework already stopped (almost). 
Here is an explanation of why this exception is being thrown:
- The app exit, 
- EclipseStarter calls the shutdown mechanism that stops all the plugins
(following the prereq graph), 
- The framework shuts down itself, causing the classloaders to be "closed". This
means that no more classes can be loaded and any attempt to load classes results
in NoClassDefFoundErrors.

It seems to me that in this case, the indexer thread (I believe this is it) has
not been killed properly and is still running while the fwk is being shutdown.


The application "org.eclipse.ui.ide.workbench" returned with code: 0.
java.lang.NoClassDefFoundError: org/eclipse/jdt/internal/core/index/EntryResult
    at
org.eclipse.jdt.internal.core.index.DiskIndex.addQueryResult(DiskIndex.java:119)
    at
org.eclipse.jdt.internal.core.index.DiskIndex.addQueryResults(DiskIndex.java:156)
    at org.eclipse.jdt.internal.core.index.Index.query(Index.java:128)
    at
org.eclipse.jdt.internal.core.search.matching.TypeDeclarationPattern.queryIn(TypeDeclarationPattern.java:189)
    at
org.eclipse.jdt.internal.core.search.matching.InternalSearchPattern.findIndexMatches(InternalSearchPattern.java:51)
    at
org.eclipse.jdt.internal.core.search.matching.MatchLocator.findIndexMatches(MatchLocator.java:266)
Comment 1 Kent Johnson CLA 2004-06-24 11:16:43 EDT
Where is the rest of the trace?

This doesn't show who requested the query.
Comment 2 Pascal Rapicault CLA 2004-06-24 11:25:02 EDT
Unfortunately this is the only information available. This has been captured in 
the console.
There is no other info available because when it happens the fwk has been 
shutdown.
Comment 3 Kent Johnson CLA 2004-06-24 11:51:35 EDT
Moving to JDT UI.

Looks like the AllTypesCache thread is not shutdown when JDT UI is shutdown.
Comment 4 Dirk Baeumer CLA 2004-06-24 11:54:08 EDT

*** This bug has been marked as a duplicate of 67753 ***