|
Re: Saving model in a resource causes IOWrappedException [message #1183949 is a reply to message #1183402] |
Wed, 13 November 2013 05:52 |
Ed Merks Messages: 33137 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!
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02025 seconds