[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform] Cannot add problem marker to project in custom classpath container code

Hi All,

I have a custom classpath container initializer that parses an xml file and populates a custom classpath container with jars contained in this file (lib dir substitute). Lots of things can go wrong during getClasspathEntries.

When things do go wrong I want to let the user know so that they can fix the problem(s). I log the exceptions to the error log. This works. However, I need a way of notifying the user so that they know something has failed and to check the error log for details.

I have tried using error dialogs: no good, because the getClasspathEntries method of my initializer may be called whilst eclipse is booting up, and is in headless mode.

I have most recently tried using problem markers. However, this is failing too with the following error: "The resource tree is locked for modifications". (Full stack trace is below.)

How am I to proceed? Can anyone provide some advice?

Thanks,

Miles

-------

org.eclipse.core.internal.resources.ResourceException: The resource tree is locked for modifications.
at org.eclipse.core.internal.resources.WorkManager.checkIn(WorkManager.java:115)
at org.eclipse.core.internal.resources.Workspace.prepareOperation(Workspace.java:1744)
at org.eclipse.core.internal.resources.Resource.createMarker(Resource.java:636)
at msjava.ide.eclipse.msde.classpath.AntBuildUtils.addAntBuildProblemMarkerTo(AntBuildUtils.java:368)
at msjava.ide.eclipse.msde.classpath.AntBuildClasspathContainer.getClasspathEntries(AntBuildClasspathContainer.java:109)
at org.eclipse.jdt.internal.core.JavaModelManager.containerPutIfInitializingWithSameEntries(JavaModelManager.java:547)
at org.eclipse.jdt.internal.core.SetContainerOperation.executeOperation(SetContainerOperation.java:49)
at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:720)
at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:780)
at org.eclipse.jdt.core.JavaCore.setClasspathContainer(JavaCore.java:4519)
at msjava.ide.eclipse.msde.classpath.AntBuildClasspathContainerInitializer.initialize(AntBuildClasspathContainerInitializer.java:48)
at org.eclipse.jdt.internal.core.JavaModelManager.initializeContainer(JavaModelManager.java:2218)
at org.eclipse.jdt.internal.core.JavaModelManager$9.run(JavaModelManager.java:2148)
at org.eclipse.jdt.internal.core.JavaModelManager.initializeAllContainers(JavaModelManager.java:2162)
at org.eclipse.jdt.internal.core.JavaModelManager.getClasspathContainer(JavaModelManager.java:1544)
at org.eclipse.jdt.core.JavaCore.getClasspathContainer(JavaCore.java:1571)
at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2558)
at org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspath(JavaProject.java:1848)
at org.eclipse.jdt.internal.core.DeltaProcessor.createExternalArchiveDelta(DeltaProcessor.java:802)
at org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged(DeltaProcessor.java:1897)
at org.eclipse.jdt.internal.core.DeltaProcessingState.resourceChanged(DeltaProcessingState.java:368)
at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:282)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:276)
at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:148)
at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:311)
at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1018)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:45)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)