|Re: [Edapt] Feature not found when migrating [message #1790752 is a reply to message #1790678]
||Fri, 15 June 2018 15:03
| Gernot Krause
Registered: June 2014
Thanks for looking into the code. With the proposed changes I was able to get the example running.
However, on my real case code it still does not work. I went done with the debugger and found that the method call resourceSet.getResource(modelURI, true) fails. This is called in ResourceUtils.loadResourceSet(...):
Both, migrateAndLoad() and migrateAndSave() are ending up at this method and, thus, both fail. So migrateAndXXX() throws an exception that the package with the nsURI from the previous model (version 1.0) was not found.
Usually, in my code I use the createResource() method to return the resource:
final ResourceSet resourceSet = new ResourceSetImpl();
Resource resource = resourceSet.createResource(modelURI);
The modelURI is exactly the same in both cases. When I try createResource() directly in my code the resource is returned without any exception. Interestingly, in ResourceUtils.loadResourceSet(...) the createResource() method was commented out. Any reasons for this?
Honestly, I am not sure what the difference between createResource() and getResource() actually is. The context help for getResource() says that: "...the package registry is used to resolve the namespace URI...". Can this be the root cause because the previous model package is not registered?
Thanks and regards,
Powered by FUDForum
. Page generated in 0.02198 seconds