Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [EVL] Could not locate a metamodel with the URI
[EVL] Could not locate a metamodel with the URI [message #1726601] Tue, 15 March 2016 01:13 Go to next message
Glatz Martin is currently offline Glatz MartinFriend
Messages: 23
Registered: March 2016
Junior Member
Hello,

I'm facing a problem with the standalone example of an EVL application in combination with the use of a metamodel deployed as eclipse plugin.

If I use the pure evl file and the corresponding run configuration (metamode-url = "http://caex") it works fine, but when I use the Standalone Example and use createEmfModelByURI
@Override
	public List<IModel> getModels() throws Exception {
		List<IModel> models = new ArrayList<IModel>();
		models.add(createEmfModelByURI("CAEX", "models/Topology.xmi", "http://caex", true, true));
		return models;
	}


it can't locate the metamodel anymore.

I did some debugging, and the problem seems to be that

[b]EPackage ePackage = EPackage.Registry.INSTANCE.getEPackage(metamodelUri.toString());[/b]
			if (ePackage == null) {
				throw new EolModelLoadingException(new IllegalArgumentException("Could not locate a metamodel with the URI '" + metamodelUri + "'. Please ensure that this metamodel has been registered with Epsilon."), this);


returns null (EMFModel.java)

I was first thinking that I've a format issue of the metamodel-URi, but when stepping through the delegate Registrys and inspecting the keymaps, the only available metamodel was ECore itself.

I did not register my meta-model as EPackage - as soon as I do so, I'm facing again the problem of not being able to call EOperations defined in the metamodel as described in https://www.eclipse.org/forums/index.php/t/1075483/

Is there maybe another option for accessing the "as plugin registered models" instead of createEmfModelByURI , as this one seems to require the EPackage Registration?

Thanks a lot in advance,

Cheers,
Martin
Re: [EVL] Could not locate a metamodel with the URI [message #1726658 is a reply to message #1726601] Tue, 15 March 2016 11:36 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

The standalone example is a regular Java application AFAIK, so it cannot use the Eclipse extension registry and therefore has no knowledge of your metamodel.

You probably want to include the metamodel plugin in the classpath of your standalone example, and then register the generated EPackage *through the code generated by EMF* (and not the .ecore, which would produce the issues you mention with EOperations) before you run your E*L script. Off the top of my head, the code would look somewhat like this:

EPackage.Registry.INSTANCE.put(YourPackage.eINSTANCE.getNsURI(), YourPackage.eINSTANCE);
// ... run your E*L script ...
Re: [EVL] Could not locate a metamodel with the URI [message #1727177 is a reply to message #1726658] Mon, 21 March 2016 00:16 Go to previous message
Glatz Martin is currently offline Glatz MartinFriend
Messages: 23
Registered: March 2016
Junior Member
Hello Antonio,

thanks a lot - that solved my problem.

Cheers,
Martin
Previous Topic:[emfatic] Converting ecore to emfatic - exception
Next Topic: MessageEnd for ETL transformation
Goto Forum:
  


Current Time: Thu Apr 25 22:28:06 GMT 2024

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

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

Back to the top