Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EPF » "Object not contained in a resource" Exception while saving
"Object not contained in a resource" Exception while saving [message #50600] Fri, 16 May 2008 14:38 Go to next message
Eclipse User
Originally posted by: quentin.deme.st.com

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é
Re: "Object not contained in a resource" Exception while saving [message #50632 is a reply to message #50600] Mon, 19 May 2008 14:55 Go to previous messageGo to next message
Eclipse User
Originally posted by: quentin.deme.st.com

I can give you an example of operations that are not performed when this
exception is thrown.

Let's consider this list of operations :
- Rename the method plugin's name to be "Some plug-in name"
- Delete milestone "IDAC"

At the time of the removal of the IDAC milestone, there is no exception
thrown. But, when I save the resource, the exception appears.

The effect, in this case (but can be very different in other cases), is
that the first operation (Rename the method plugin's name) has not been
performed.

I really need your help.

Thanks in advance,

Quentin Demé
Re: "Object not contained in a resource" Exception while saving [message #50660 is a reply to message #50632] Wed, 28 May 2008 11:16 Go to previous message
Eclipse User
Originally posted by: qdeme.yahoo.fr

Apparently, it seems I've found a good solution to my problem. I'll
explain it here, in case someone have the same problem as mine.

I noticed that the problem was always the same : the modification that
couldn't be performed was always the same. The name of the project (of the
Method Plug-in) couldn't be changed.

So I just had the idea to load the Method Plugin again (the instanciated
project), after the instanciation, and then just change the name (because
changing a name has never caused any problem).

And then, I have my project with the removed features and the correct name
I wanted it to have.
Re: "Object not contained in a resource" Exception while saving [message #589390 is a reply to message #50600] Mon, 19 May 2008 14:55 Go to previous message
Eclipse User
Originally posted by: quentin.deme.st.com

I can give you an example of operations that are not performed when this
exception is thrown.

Let's consider this list of operations :
- Rename the method plugin's name to be "Some plug-in name"
- Delete milestone "IDAC"

At the time of the removal of the IDAC milestone, there is no exception
thrown. But, when I save the resource, the exception appears.

The effect, in this case (but can be very different in other cases), is
that the first operation (Rename the method plugin's name) has not been
performed.

I really need your help.

Thanks in advance,

Quentin Demé
Re: "Object not contained in a resource" Exception while saving [message #589401 is a reply to message #50632] Wed, 28 May 2008 11:16 Go to previous message
Eclipse User
Originally posted by: qdeme.yahoo.fr

Apparently, it seems I've found a good solution to my problem. I'll
explain it here, in case someone have the same problem as mine.

I noticed that the problem was always the same : the modification that
couldn't be performed was always the same. The name of the project (of the
Method Plug-in) couldn't be changed.

So I just had the idea to load the Method Plugin again (the instanciated
project), after the instanciation, and then just change the name (because
changing a name has never caused any problem).

And then, I have my project with the removed features and the correct name
I wanted it to have.
Previous Topic:"Object not contained in a resource" Exception while saving
Next Topic:Creating guidances and publishing from code
Goto Forum:
  


Current Time: Thu Oct 23 21:33:40 GMT 2014

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

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