[CDO] Import from XMI throws DanglingReferenceException [message #1462715] |
Wed, 05 November 2014 16:57  |
Eclipse User |
|
|
|
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 16:58] by Moderator
|
|
|
|
Re: [CDO] [message #1470352 is a reply to message #1462715] |
Wed, 12 November 2014 04:10  |
Eclipse User |
|
|
|
Hi Richard,
Which release of CDO do you use?
If you have the bug with the last one, could you write a JUnit test to
reproduce your issue?
Best Regards.
Le 05/11/2014 22:57, Richard Meyer a écrit :
> 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
>
--
Esteban Dugueperoux - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Powered by
FUDForum. Page generated in 0.10163 seconds