Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » ECoreUtil.resolveAll on multi-file ecore meta-model results in "unresolved proxy" errors.(resolveAll unresolved proxy error)
ECoreUtil.resolveAll on multi-file ecore meta-model results in "unresolved proxy" errors. [message #1831204] Thu, 13 August 2020 16:11 Go to next message
Harmon Nine is currently offline Harmon NineFriend
Messages: 3
Registered: July 2009
Junior Member
Hello.

I'm getting "unresolved proxy" errors when trying to execute "ECoreUtils.resolvedAll" on an emf metamodel.

The metamodel is stored in two files:

/path/to/metamodel/file/master.ecore
/path/to/metamodel/file/referenced.ecore


The "master" file references items in the "referenced" file using proxies that look like this:

<eStructuralFeatures xsi:type="ecore:EReference" name="rm" ordered="false" upperBound="-1"
eType="ecore:EClass referenced.ecore#//ReferencedModel" containment="true"/>


The calls that are being used to load and resolve the "master" file are as follows:


(This code is from "https://github.com/atlanmod/mondo-atlzoo-benchmark/blob/master/fr.inria.atlanmod.instantiator/src/fr/inria/atlanmod/instantiator/Launcher.java")
--------------------------------
String metamodel = commandLine.getOptionValue(METAMODEL);

Resource metamodelResource = new XMIResourceImpl(URI.createFileURI(metamodel));
metamodelResource.load(Collections.emptyMap());

EcoreUtil.resolveAll(metamodelResource);
--------------------------------

For each proxy in the master.ecore file, the "EcoreUtil.resolveAll()" call
results in the following 4 error messages. There are 13 such proxies, so 52 error message in total:

--------------------------------
Aug 12, 2020 12:22:21 PM fr.inria.atlanmod.instantiator.Launcher main
SEVERE: The feature 'eType' of
'org.eclipse.emf.ecore.impl.EReferenceImpl@6293abcc{file:/path/to/metamodel/file/master.ecore#//MasterModel/rm}' contains an unresolved proxy 'org.eclipse.emf.ecore.impl.EClassImpl@794cb805{file:/path/to/metamodel/file/referenced.ecore#//ReferencedModel}'

Aug 12, 2020 12:22:21 PM fr.inria.atlanmod.instantiator.Launcher main
SEVERE: The feature 'eReferenceType' of
'org.eclipse.emf.ecore.impl.EReferenceImpl@6293abcc{file:/path/to/metamodel/file/master.ecore#//MasterModel/rm}' contains an unresolved proxy 'org.eclipse.emf.ecore.impl.EClassImpl@794cb805{file:/path/to/metamodel/file/referenced.ecore#//ReferencedModel}'

Aug 12, 2020 12:22:21 PM fr.inria.atlanmod.instantiator.Launcher main
SEVERE: The feature 'eRawType' of
'org.eclipse.emf.ecore.impl.EGenericTypeImpl@4b5a5ed1{file:/path/to/metamodel/file/master.ecore#//MasterModel/rm/@eGenericType}' contains an unresolved proxy 'org.eclipse.emf.ecore.impl.EClassImpl@794cb805{file:/path/to/metamodel/file/referenced.ecore#//ReferencedModel}'

Aug 12, 2020 12:22:21 PM fr.inria.atlanmod.instantiator.Launcher main
SEVERE: The feature 'eClassifier' of
'org.eclipse.emf.ecore.impl.EGenericTypeImpl@4b5a5ed1{file:/path/to/metamodel/file/master.ecore#//MasterModel/rm/@eGenericType}' contains an unresolved proxy 'org.eclipse.emf.ecore.impl.EClassImpl@794cb805{file:/path/to/metamodel/file/referenced.ecore#//ReferencedModel}'
--------------------------------

Note that the URL to the "referenced.ecore" file i.e. "file:/path/to/metamodel/file/referenced.ecore", is correct.


What function/method calls are needed to get these proxies to resolve in the call to "EcoreUtil.resolveAll()"?

Thanks
-- Harmon
Re: ECoreUtil.resolveAll on multi-file ecore meta-model results in "unresolved proxy" erro [message #1831207 is a reply to message #1831204] Thu, 13 August 2020 17:41 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31839
Registered: July 2009
Senior Member
You must use a resource set as I illustrated with the required code in my reply on the emf-dev mailing list:

https://www.eclipse.org/lists/emf-dev/msg01889.html

To repeat it here, do this:
    ResourceSet resourceSet = new ResourceSetImpl();
    resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("ecore", new EcoreResourceFactoryImpl());
    resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("*", new XMIResourceFactoryImpl());
    Resource metamodelResource  = resourceSet.getResource(URI.createFileURI(metamodel), true);


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Single class, multiple lines in XML represenation.
Next Topic:Generating edit code for referenced models
Goto Forum:
  


Current Time: Tue Apr 20 02:29:30 GMT 2021

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

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

Back to the top