Community
Participate
Working Groups
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)
This is on 20030115
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.
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.
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).
Added workaround (marked with a TODO: tag) to not use IWorkspace.run(...) when the resource tree is locked. Added regression test ClasspathInitializerTest.testContainerInitializer4()
*** Bug 29690 has been marked as a duplicate of this bug. ***
Verified.