[CDO] Import from XMI throws DanglingReferenceException [message #1462715] |
Wed, 05 November 2014 21:57 |
Richard Meyer Messages: 40 Registered: June 2012 |
Member |
|
|
Hy,
I try to import model elements from XMI in my CDO model but getting the following exception:
Caused by: org.eclipse.emf.cdo.util.DanglingReferenceException: The object "MyClass?(my.class.MyClassImpl)" is not contained in a resource
First I export parts of my model to XMI.
This parts contains references to objects in the CDO model.
The XMI File contains hrefs like this:
<ClassA >
<MyClass href="cdo://1ef75ed3-3465-4939-9bd9-32bceb126e7c/myResource#L5"/>
</ClassA>
Now I want to import this XMI file to the same CDO model where it original comes from.
The target of the reference does definitely still exists.
ResourceSet resSet = new ResourceSetImpl();
Map<String, Object> m = resSet.getResourceFactoryRegistry () .getExtensionToFactoryMap () ;
m.put("*", new XMIResourceFactoryImpl());
resSet.setPackageRegistry ( getTransaction().getSession() .getPackageRegistry ()) ;
Resource resource = resSet.getResource(URI.createURI(path), true);
ClassA clA = (ClassA) resource.getContents().get(0);
If I try to add "clA" to my CDO model the mentioned exception is raised.
Thanks for any advice
[Updated on: Wed, 05 November 2014 21:58] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02775 seconds