|Re: No report for failing ProjectsImportTask. [message #1424806 is a reply to message #1424651]
||Tue, 16 September 2014 12:52
| Arthur Daussy
Registered: September 2014
First thanks for your answer.
> I was wondering if there is a way to catch an event or a log for a
> failing ProjectImportTask. Let's say that the setup file contains a
> ProjectImportTask with a SourceLocator pointing to an incorrect
> location. When perfoming the task Oomph runs it but do not fail and
> does not log any error. There is a multistatus object but it seems not
> to be filled neither displayed by the context.
Eike is on vacation, but it looks to me like the intent of that design
must be to do something with that status object...
Yes I agree that the status object should be used somewhere to check if something went wrong but I could not find where etiher.
When you say it seems not to be filled, you looked with the debugger and
saw that no children were added to the status?
Yes I have debugged the application and I think the problem is in:
public static BackendContainer getRootContainer(SourceLocator sourceLocator)
String rootFolder = sourceLocator.getRootFolder();
BackendResource rootResource = BackendResource.get(rootFolder);
if (rootResource instanceof BackendContainer)
In my case BackendResource.get(rootFolder) does not return a BackendContainer so this method returns null. This implies that nothing is done in:
org.eclipse.oomph.resources.impl.SourceLocatorImpl.handleProjects(SourceLocator, EList<ProjectFactory>, ProjectHandler, MultiStatus, IProgressMonitor).
public static void handleProjects(final SourceLocator sourceLocator, final EList<ProjectFactory> defaultProjectFactories,
final ProjectHandler projectHandler, final MultiStatus status, final IProgressMonitor monitor)
final BackendContainer rootContainer = SourceLocatorImpl.getRootContainer(sourceLocator);
if (rootContainer != null)
private final Set<String> excludedPaths = new HashSet<String>(sourceLocator.getExcludedPaths());
public boolean visitContainer(BackendContainer container, IProgressMonitor monitor) throws BackendException
String path = container.getSystemRelativePath();
IProject project = loadProject(sourceLocator, defaultProjectFactories, rootContainer, container, monitor);
if (ResourcesUtil.matchesPredicates(project, sourceLocator.getPredicates()))
catch (Exception ex)
SourceLocatorImpl.addStatus(status, ResourcesPlugin.INSTANCE, project.getName(), ex);
Maybe the case where rootContainer == null should be handle and log into the status.
Here the related bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=444250.
That thread looks complete. What question is left outstanding?
I would like to have your thoughts on this part (this is my mistake I should have opened a second discussion):
> I have another question wich is not directly related to this problem but linked to the ProjectImportTask implementation. I was wondering why do you use a property file to keep track of the imported projects (.plugins/org.eclipse.oomph.setup.projects/import-history.properties)? In my use case, each time I open a eclipse I have to clear all the projects of the workspace. Then I only import the project defined in the Oomph model. However with the current implementation the "isNeeded" method returns false because the property file seems corrupted (it has a key for my project but no value. So it returns "" instead of null). Each time I clear my workspace I need to clear this property file too. It feels a bit like a hack so I was wondering if there is a ClearWorkspace task that I have missed.
I think Ed wants to comment on this issue because he's implemented the import history...
Thanks again for your help,
|Re: No report for failing ProjectsImportTask. [message #1424959 is a reply to message #1424806]
||Tue, 16 September 2014 17:09
| Ed Merks
Registered: July 2009
On 16/09/2014 2:52 PM, Arthur Daussy wrote:
> I would like to have your thoughts on this part (this is my mistake I
> should have opened a second discussion):
>> > I have another question wich is not directly related to this
>> problem but linked to the ProjectImportTask implementation. I was
>> wondering why do you use a property file to keep track of the
>> imported projects
We need some way of determining whether the task needs to be performed,
otherwise it would perform on each startup...
>> In my use case, each time I open a eclipse I have to clear all the
>> projects of the workspace.
>> Then I only import the project defined in the Oomph model.
I'm not sure I follow...
>> However with the current implementation the "isNeeded" method returns
>> false because the property file seems corrupted (it has a key for my
>> project but no value. So it returns "" instead of null).
If the task successfully completes (and that's likely the problem it
looks successful but wasn't really), it records the projects that were
actually imported and as long as those are present, it doesn't perform
again. It also computes digest of the source locator, so if that
changes, it will perform again. So of course if you "successfully
import" no projects then there are no projects to test and nothing is
done on startup. For manual trigger it will always be performed.
>> Each time I clear my workspace I need to clear this property file
>> too. It feels a bit like a hack so I was wondering if there is a
>> ClearWorkspace task that I have missed.
IProject) method should save the value for the property; it should be
a list of the projects successfully imported...
>> I think Ed wants to comment on this issue because he's implemented
>> the import history...
I was traveling so missed that; sorry.
Powered by FUDForum
. Page generated in 0.01396 seconds