Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Saving model in a resource causes IOWrappedException
Saving model in a resource causes IOWrappedException [message #1183402] Tue, 12 November 2013 21:07 Go to next message
Ken Keefe is currently offline Ken KeefeFriend
Messages: 38
Registered: September 2009
Member
I am running into a problem while saving an EMF model. Here is the exception I am getting:

org.eclipse.emf.ecore.resource.Resource$IOWrappedException: The object 'edu.illinois.mobius.core.projects.models.impl.WorkspaceManagerImpl@2ace5406 (<SNIP>)' is not contained in a resource.
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.endSave(XMLSaveImpl.java:307)
at org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.save(XMLSaveImpl.java:271)
at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doSave(XMLResourceImpl.java:333)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:1423)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:992)
at edu.illinois.mobius.core.projects.models.impl.ProjectImpl.save(ProjectImpl.java:617)
......<SNIP>

So, I have an object called WorkspaceManager that contains several Project objects. I have to keep the reference from WorkspaceManager to Project a containment reference because I'm actually using the map functionality in EMF and it requires the containment attribute be true. Now, I am trying to save just the Project object and it has no references or attributes that point to a WorkspaceManager object. It does have an EOperation that returns a WorkspaceManager object, but I don't think that's the problem. I'm wondering if when it is serializing the Project object, it is also serializing its eContainer. If that's the case, how do I stop that?

Thanks!
Re: Saving model in a resource causes IOWrappedException [message #1183949 is a reply to message #1183402] Wed, 13 November 2013 05:52 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30692
Registered: July 2009
Senior Member
Ken,

Comments below.

On 12/11/2013 10:07 PM, Ken Mising name wrote:
> I am running into a problem while saving an EMF model. Here is the
> exception I am getting:
> org.eclipse.emf.ecore.resource.Resource$IOWrappedException: The object
> mailto:'edu.illinois.mobius.core.projects.models.impl.WorkspaceManagerImpl@2ace5406
> (<SNIP>)' is not contained in a resource.
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.endSave(XMLSaveImpl.java:307)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLSaveImpl.save(XMLSaveImpl.java:271)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doSave(XMLResourceImpl.java:333)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:1423)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:992)
> at
> edu.illinois.mobius.core.projects.models.impl.ProjectImpl.save(ProjectImpl.java:617)
> .....<SNIP>
>
> So, I have an object called WorkspaceManager that contains several
> Project objects. I have to keep the reference from WorkspaceManager to
> Project a containment reference because I'm actually using the map
> functionality in EMF and it requires the containment attribute be
> true. Now, I am trying to save just the Project object and it has no
> references or attributes that point to a WorkspaceManager object. It
> does have an EOperation that returns a WorkspaceManager object, but I
> don't think that's the problem. I'm wondering if when it is
> serializing the Project object, it is also serializing its eContainer.
If there's a container EReference and if that's not transient, it will
serialize that. So you could make that transient, but you've not
mentioned having such a reference.
> If that's the case, how do I stop that?
By making it transient. Otherwise, it sounds like a
DanglingHREFException so you can set an exception breakpoint (the little
J! icon in the Breakpoints view) and see which reference is causing the
problem. Or you can use
org.eclipse.emf.ecore.xmi.XMLResource.OPTION_PROCESS_DANGLING_HREF to
just ignore them.
> Thanks!
Previous Topic:How to access certain EStructuralFeatures?
Next Topic:Turn on/off proxy resolving globally
Goto Forum:
  


Current Time: Thu Dec 12 18:26:56 GMT 2019

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

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

Back to the top