Bug 264301 - AssertionFailedException resolving JavaProject classpath
Summary: AssertionFailedException resolving JavaProject classpath
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 critical (vote)
Target Milestone: 3.7 RC1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-10 00:20 EST by Craig Setera CLA
Modified: 2011-05-13 04:09 EDT (History)
4 users (show)

See Also:
Olivier_Thomann: review+


Attachments
Fix (1.05 KB, patch)
2011-05-03 08:26 EDT, Dani Megert CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Setera CLA 2009-02-10 00:20:15 EST
Attempting to use Eclipse 3.5M5 against a previous workspace and I'm receiving an AssertionFailedException related to the resolution of Java classpath entries.  I've also attemped to import the project into a clean workspace and receive the same error.  

In the method, JavaProject#addToResult(IClasspathEntry rawEntry, IClasspathEntry resolvedEntry, ResolvedClasspath result, LinkedHashSet resolvedEntries, ExternalFoldersManager externalFoldersManager)

The curious values are:
JavaProject=EnrollmentSupport (not open)
rawEntry=/EnrollmentSupport/lib/jaxb-xjc.jar[CPE_LIBRARY][K_BINARY][isExported:false]
resolvedEntry=/[CPE_LIBRARY][K_BINARY][isExported:false]

The resolved entry in this case doesn't make any sense at all.  The stack trace follows:

Daemon Thread [Thread-0] (Suspended (exception AssertionFailedException))	
	Assert.isNotNull(Object, String) line: 85	
	Assert.isNotNull(Object) line: 73	
	Path.initialize(String, String) line: 577	
	Path.<init>(String, String) line: 185	
	WorkspaceRoot.getProject(String) line: 177	
	ExternalFoldersManager.isExternalFolderPath(IPath) line: 77	
	JavaProject.addToResult(IClasspathEntry, IClasspathEntry, JavaProject$ResolvedClasspath, LinkedHashSet, ExternalFoldersManager) line: 2597	
	JavaProject.resolveClasspath(IClasspathEntry[], boolean, boolean) line: 2574	
	JavaProject.resolveClasspath(JavaModelManager$PerProjectInfo, boolean) line: 2625	
	DeltaProcessingState.getRootInfos(boolean) line: 262	
	DeltaProcessingState.initializeRootsWithPreviousSession() line: 232	
	JavaModelManager.startup() line: 4480	
	JavaCore.start(BundleContext) line: 4932	
	BundleContextImpl$1.run() line: 804	
	AccessController.doPrivileged(PrivilegedExceptionAction<T>) line: not available [native method]	
	BundleContextImpl.startActivator(BundleActivator) line: 798	
	BundleContextImpl.start() line: 779	
	BundleHost.startWorker(int) line: 352	
	BundleHost(AbstractBundle).start(int) line: 280	
	SecureAction.start(Bundle, int) line: 400	
	EclipseLazyStarter.postFindLocalClass(String, Class, ClasspathManager) line: 111	
	ClasspathManager.findLocalClass(String) line: 443	
	DefaultClassLoader.findLocalClass(String) line: 193	
	BundleLoader.findLocalClass(String) line: 372	
	SingleSourcePackage.loadClass(String) line: 33	
	BundleLoader.findClassInternal(String, boolean, ClassLoader) line: 445	
	BundleLoader.findClass(String, boolean) line: 401	
	BundleLoader.findClass(String) line: 389	
	DefaultClassLoader.loadClass(String, boolean) line: 87	
	DefaultClassLoader(ClassLoader).loadClass(String) line: 251	
	DefaultClassLoader(ClassLoader).loadClassInternal(String) line: 374	
	Class<T>.getDeclaredConstructors0(boolean) line: not available [native method]	
	Class<T>.privateGetDeclaredConstructors(boolean) line: 2357	
	Class<T>.getConstructor0(Class[], int) line: 2671	
	Class<T>.newInstance0() line: 321	
	Class<T>.newInstance() line: 303	
	BundleHost(AbstractBundle).loadBundleActivator() line: 152	
	BundleContextImpl.start() line: 775	
	BundleHost.startWorker(int) line: 352	
	BundleHost(AbstractBundle).start(int) line: 280	
	SecureAction.start(Bundle, int) line: 400	
	EclipseLazyStarter.postFindLocalClass(String, Class, ClasspathManager) line: 111	
	ClasspathManager.findLocalClass(String) line: 443	
	DefaultClassLoader.findLocalClass(String) line: 193	
	BundleLoader.findLocalClass(String) line: 372	
	BundleLoader.findClassInternal(String, boolean, ClassLoader) line: 448	
	BundleLoader.findClass(String, boolean) line: 401	
	BundleLoader.findClass(String) line: 389	
	DefaultClassLoader.loadClass(String, boolean) line: 87	
	DefaultClassLoader(ClassLoader).loadClass(String) line: 251	
	BundleLoader.loadClass(String) line: 317	
	BundleHost.loadClass(String, boolean) line: 231	
	BundleHost(AbstractBundle).loadClass(String) line: 1279	
	EquinoxRegistryStrategy(RegistryStrategyOSGI).createExecutableExtension(RegistryContributor, String, String) line: 160	
	ExtensionRegistry.createExecutableExtension(RegistryContributor, String, String) line: 874	
	ConfigurationElement.createExecutableExtension(String) line: 243	
	ConfigurationElementHandle.createExecutableExtension(String) line: 51	
	WorkbenchPlugin$1.run() line: 267	
	BusyIndicator.showWhile(Display, Runnable) line: 70	
	WorkbenchPlugin.createExtension(IConfigurationElement, String) line: 263	
	EditorDescriptor.createEditor() line: 234	
	EditorManager.createPart(EditorDescriptor) line: 849	
	EditorReference.createPartHelper() line: 622	
	EditorReference.createPart() line: 444	
	EditorReference(WorkbenchPartReference).getPart(boolean) line: 595	
	EditorAreaHelper.setVisibleEditor(IEditorReference, boolean) line: 271	
	EditorManager.setVisibleEditor(IEditorReference, boolean) line: 1413	
	EditorManager$5.runWithException() line: 947	
	EditorManager$5(StartupThreading$StartupRunnable).run() line: 31	
	RunnableLock.run() line: 35	
	UISynchronizer(Synchronizer).runAsyncMessages(boolean) line: 133	
	Display.runAsyncMessages(boolean) line: 3000	
	Display.readAndDispatch() line: 2749	
	IDEWorkbenchAdvisor(WorkbenchAdvisor).openWindows() line: 803	
	Workbench$27.runWithException() line: 1367	
	Workbench$27(StartupThreading$StartupRunnable).run() line: 31	
	RunnableLock.run() line: 35	
	UISynchronizer(Synchronizer).runAsyncMessages(boolean) line: 133	
	Display.runAsyncMessages(boolean) line: 3000	
	Display.readAndDispatch() line: 2749	
	Workbench.runUI() line: 2299	
	Workbench.access$4(Workbench) line: 2204	
	Workbench$5.run() line: 499	
	Realm.runWithDefault(Realm, Runnable) line: 333	
	Workbench.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 492	
	PlatformUI.createAndRunWorkbench(Display, WorkbenchAdvisor) line: 149	
	IDEApplication.start(IApplicationContext) line: 113	
	EclipseAppHandle.run(Object) line: 194	
	EclipseAppLauncher.runApplication(Object) line: 110	
	EclipseAppLauncher.start(Object) line: 79	
	EclipseStarter.run(Object) line: 368	
	EclipseStarter.run(String[], Runnable) line: 179	
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]	
	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39	
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25	
	Method.invoke(Object, Object...) line: 585	
	Main.invokeFramework(String[], URL[]) line: 556	
	Main.basicRun(String[]) line: 511	
	Main.run(String[]) line: 1270	
	Main.main(String[]) line: 1246
Comment 1 Craig Setera CLA 2009-02-10 09:37:54 EST
I should add that I have an installation and can collect more information if it helps.  I just wasn't sure what might be useful.
Comment 2 Dani Megert CLA 2011-05-03 08:24:45 EDT
This was ugly before but with the fix for bug 336046 this can result in JDT Core not even starting up and hence also JDT UI not being able to start.

Test Case (3.7 M7):
1. start fresh workspace
2. create Java project 'P'
3. change the source attachment of 'rt.jar' to "C:"
==> you'll get tons of errors
4. try to expand some of the JARs
==> you'll get tons of errors
5. exit
6. start
==> Package Explorer (whole JDT UI) doesn't load
Comment 3 Dani Megert CLA 2011-05-03 08:26:00 EDT
Created attachment 194566 [details]
Fix
Comment 4 Dani Megert CLA 2011-05-03 08:26:33 EDT
Markus, can you +1 this as second committer besides Olivier?
Comment 5 Dani Megert CLA 2011-05-03 08:28:24 EDT
(In reply to comment #4)
> Markus, can you +1 this as second committer besides Olivier?
Actually that's not needed as the rules don't require the committer to be from the same component.

+1 for RC1.
Comment 6 Olivier Thomann CLA 2011-05-03 09:06:11 EDT
Looks good. I'll commit today.
Comment 7 Dani Megert CLA 2011-05-03 09:09:06 EDT
Olivier, I think this would be a good one for 3.6.2+.
Comment 8 Olivier Thomann CLA 2011-05-03 09:17:13 EDT
Even if bug 336046 was not released for 3.6.2+, we can still release that fix for 3.6.2+.
Comment 9 Olivier Thomann CLA 2011-05-03 10:54:30 EDT
Released in BETA_JAVA7, HEAD and 3_6_maintenance with a regression test.
Comment 10 Dani Megert CLA 2011-05-06 03:29:32 EDT
Verified for 3.7 in I20110505-0800.
Comment 11 Ayushman Jain CLA 2011-05-13 04:09:15 EDT
Verified for 3.7RC1 using build I20110511-0800.