[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.technology.epf] "Object not contained in a resource" Exception while saving

Hello,

I've made an EPF Composer plug-in allowing to instanciate a project from a model defined with EPF.

In the plug-in, the user can make changes about things existing in the specified model.

The instanciation needs to load a resource, and remove some tasks and milestones from it. I use TaskDescriptorImpl.delete(), and there's no problem, until I use resource.save(map).

resource.save(map) gives the following exception :

Exception save() : org.eclipse.emf.ecore.resource.Resource$IOWrappedException: The object 'org.eclipse.epf.uma.impl.MilestoneImpl@174aee5 (name: ) (guid: , briefDescription: , suppressed: false, orderingGuide: ) (presentationName: , shapeicon: null, nodeicon: null) (prefix: , isPlanned: true, hasMultipleOccurrences: false, isOptional: false) (isRepeatable: false, isOngoing: false, isEventDriven: false)' is not contained in a resource.

In this case, it's the removal of a milestone that provokes this error.

I've searched the Internet, and I found that this exception means that an object A contains a reference to the removed object B.

I tried other functions like TaskDescriptorImpl.removeFromAllOppositeFeatures(), or setSuppressed(true), in addition to delete().
I also tried to cast into TaskDescriptor and do setSuppressed(true) and delete()... It doesn't solve the problem.


This is the very last problem that occurs in my project, and I really need your help. The modifications that the user makes are not correctly done, and some modifications are not performed, because of this exception.

Thanks in advance,

Quentin Demé