Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Cannot add problem marker to project in custom classpath container code
Cannot add problem marker to project in custom classpath container code [message #328391] Fri, 23 May 2008 17:19 Go to next message
Miles Daffin is currently offline Miles DaffinFriend
Messages: 86
Registered: July 2009
Member
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(Work Manager.java:115)
at
org.eclipse.core.internal.resources.Workspace.prepareOperati on(Workspace.java:1744)
at
org.eclipse.core.internal.resources.Resource.createMarker(Re source.java:636)
at
msjava.ide.eclipse.msde.classpath.AntBuildUtils.addAntBuildP roblemMarkerTo(AntBuildUtils.java:368)
at
msjava.ide.eclipse.msde.classpath.AntBuildClasspathContainer .getClasspathEntries(AntBuildClasspathContainer.java:109)
at
org.eclipse.jdt.internal.core.JavaModelManager.containerPutI fInitializingWithSameEntries(JavaModelManager.java:547)
at
org.eclipse.jdt.internal.core.SetContainerOperation.executeO peration(SetContainerOperation.java:49)
at
org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaMod elOperation.java:720)
at
org.eclipse.jdt.internal.core.JavaModelOperation.runOperatio n(JavaModelOperation.java:780)
at org.eclipse.jdt.core.JavaCore.setClasspathContainer(JavaCore .java:4519)
at
msjava.ide.eclipse.msde.classpath.AntBuildClasspathContainer Initializer.initialize(AntBuildClasspathContainerInitializer .java:48)
at
org.eclipse.jdt.internal.core.JavaModelManager.initializeCon tainer(JavaModelManager.java:2218)
at
org.eclipse.jdt.internal.core.JavaModelManager$9.run(JavaMod elManager.java:2148)
at
org.eclipse.jdt.internal.core.JavaModelManager.initializeAll Containers(JavaModelManager.java:2162)
at
org.eclipse.jdt.internal.core.JavaModelManager.getClasspathC ontainer(JavaModelManager.java:1544)
at org.eclipse.jdt.core.JavaCore.getClasspathContainer(JavaCore .java:1571)
at
org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(J avaProject.java:2558)
at
org.eclipse.jdt.internal.core.JavaProject.getResolvedClasspa th(JavaProject.java:1848)
at
org.eclipse.jdt.internal.core.DeltaProcessor.createExternalA rchiveDelta(DeltaProcessor.java:802)
at
org.eclipse.jdt.internal.core.DeltaProcessor.resourceChanged (DeltaProcessor.java:1897)
at
org.eclipse.jdt.internal.core.DeltaProcessingState.resourceC hanged(DeltaProcessingState.java:368)
at
org.eclipse.core.internal.events.NotificationManager$2.run(N otificationManager.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.broadca stChanges(NotificationManager.java:148)
at
org.eclipse.core.internal.resources.Workspace.broadcastPostC hange(Workspace.java:311)
at
org.eclipse.core.internal.resources.Workspace.endOperation(W orkspace.java:1018)
at
org.eclipse.core.internal.resources.InternalWorkspaceJob.run (InternalWorkspaceJob.java:45)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Re: Cannot add problem marker to project in custom classpath container code [message #328396 is a reply to message #328391] Fri, 23 May 2008 18:41 Go to previous message
Eclipse UserFriend
Originally posted by: kosta.bea.com

I would recommend using the Jobs API to schedule a job to run later and
place the markers. When you schedule a job, use the IResource that you
want to place the marker on as the scheduling rule. That way when your
job is activated, you will know that you will be able to place the marker.

- Konstantin
Previous Topic:RCP: EditorPart and IsDirty
Next Topic:Binding the attribute of a bean object wrapped in a WritableValue object
Goto Forum:
  


Current Time: Wed Feb 05 04:53:19 GMT 2025

Powered by FUDForum. Page generated in 0.05159 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top