Bug 29585

Summary: Core Exception as resource tree is locked initializing classpath container
Product: [Eclipse Project] JDT Reporter: Darin Swanson <Darin_Swanson>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, mlq.eclipse
Version: 2.1   
Target Milestone: 2.1 M5   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Bug Depends on: 29624    
Bug Blocks:    

Description Darin Swanson CLA 2003-01-15 18:22:34 EST
Java Model Exception: Core Exception [code 4] The resource tree is locked for 
modifications.
at org.eclipse.jdt.core.JavaCore.setClasspathContainer(JavaCore.java:2705)
at org.eclipse.jdt.internal.launching.JREContainerInitializer.initialize
(JREContainerInitializer.java:59)
at org.eclipse.jdt.core.JavaCore$1.run(JavaCore.java:827)
at org.eclipse.core.internal.runtime.InternalPlatform.run
(InternalPlatform.java:852)
at org.eclipse.core.runtime.Platform.run(Platform.java:413)
at org.eclipse.jdt.core.JavaCore.getClasspathContainer(JavaCore.java:822)
at org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspath
(JavaProject.java:1490)
at org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspath
(JavaProject.java:1406)
at org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspath
(JavaProject.java:1382)
at org.eclipse.jdt.internal.core.DeltaProcessor.initializeRoots
(DeltaProcessor.java:1076)
at org.eclipse.jdt.internal.core.DeltaProcessor.processResourceDelta
(DeltaProcessor.java:1349)
at org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged
(DeltaProcessor.java:1636)
at org.eclipse.core.internal.events.NotificationManager$1.run
(NotificationManager.java:137)
at org.eclipse.core.internal.runtime.InternalPlatform.run
(InternalPlatform.java:852)
at org.eclipse.core.runtime.Platform.run(Platform.java:413)
at org.eclipse.core.internal.events.NotificationManager.notify
(NotificationManager.java:152)
at org.eclipse.core.internal.events.NotificationManager.broadcastChanges
(NotificationManager.java:67)
at org.eclipse.core.internal.resources.Workspace.broadcastChanges
(Workspace.java:154)
at org.eclipse.core.internal.resources.Workspace.endOperation
(Workspace.java:885)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1585)
at org.eclipse.debug.internal.core.BreakpointManager$5.run
(BreakpointManager.java:690)
at java.lang.Thread.run(Thread.java:536)
Comment 1 Darin Swanson CLA 2003-01-15 18:22:51 EST
This is on 20030115
Comment 2 Darin Wright CLA 2003-01-15 20:10:04 EST
Are there steps to reproduce? I am going to place this in JDT-CORE for comment, 
as they have asked us to initialize, and thus, we must call 
JavaCore#setClasspathContainer.
Comment 3 Darin Swanson CLA 2003-01-15 21:35:26 EST
I started up 20030115 on an old workspace.
Debugged a self hosting session.
Shutdown.
Restarted.
Exceptions logged (appears to be an eclipse.exe hung saying completing install)
On further restarts no exceptions logged.
Comment 4 Philipe Mulet CLA 2003-01-16 04:27:02 EST
Seems like we should ensure not to invoke initializers during postchange 
notification. Maybe initialize the roots also during prebuild/postbuild ?

Curiously, it would be worth reproducing to understand why a resource 
modification occurs at all when only an initializer is performed (the raw 
classpath isn't modified, and thus should not trigger a saveClasspath action).
Comment 5 Jerome Lanneluc CLA 2003-01-17 07:07:22 EST
Added workaround (marked with a TODO: tag) to not use IWorkspace.run(...) when 
the resource tree is locked.

Added regression test ClasspathInitializerTest.testContainerInitializer4()
Comment 6 Jerome Lanneluc CLA 2003-01-17 07:09:38 EST
*** Bug 29690 has been marked as a duplicate of this bug. ***
Comment 7 David Audel CLA 2003-02-10 10:21:56 EST
Verified.