Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [Emfatic] Error while importing ecore
[Emfatic] Error while importing ecore [message #1066694] Wed, 03 July 2013 15:19 Go to next message
Phil H is currently offline Phil H
Messages: 267
Registered: November 2012
Senior Member
Hi,

I tried to import an ecore from another project to an emf file, but still get an error "Failed to resolve type: PL". Here are both emf files:

pld.emf:

@namespace(
	uri="/org.model.variability/model/pld.ecore",
	prefix="")

package pld;

@gmf.diagram(onefile="true", diagram.extension="pld", model.extension="pld")
class PL{

  	unsettable attr EString name = "PL";
}


and hw.emf, located in another project:

@namespace(
	uri="/org.model.variability.hw/model/hw.ecore",
	prefix="")

package hw;

import "platform:/resource/org.model.variability/model/pld.ecore";

@gmf.node(label="name", label.icon="false", color="238,233,233", border.color="0,0,0", resizable="false")
class Platform{
  	unsettable attr EString name = "Platform";	
  	
  	ref PL pl;
}


Am I doing something wrong with my import?

Cheers,
Phil
Re: [Emfatic] Error while importing ecore [message #1066769 is a reply to message #1066694] Thu, 04 July 2013 06:01 Go to previous messageGo to next message
Phil H is currently offline Phil H
Messages: 267
Registered: November 2012
Senior Member
Ok, it seems that the missing package name in front of the class is causing this. So using ref pld.PL pl; is accepted.

But when I try to generate an GMF editor with Eugenia, I get a NPE:

java.lang.NullPointerException
	at org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl$DependencyHelper.handle(GenPackageImpl.java:2417)
	at org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl$DependencyHelper.<init>(GenPackageImpl.java:2325)
	at org.eclipse.emf.codegen.ecore.genmodel.impl.GenPackageImpl.prepareCache(GenPackageImpl.java:3139)
	at org.eclipse.emf.codegen.ecore.genmodel.generator.GenPackageGeneratorAdapter.doPreGenerate(GenPackageGeneratorAdapter.java:177)
	at org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter.preGenerate(AbstractGeneratorAdapter.java:250)
	at org.eclipse.emf.codegen.ecore.generator.Generator.generate(Generator.java:640)
	at org.eclipse.emf.codegen.ecore.generator.Generator.generate(Generator.java:559)
	at org.eclipse.epsilon.eugenia.GenerateEmfCodeDelegate.runImpl(GenerateEmfCodeDelegate.java:43)
	at org.eclipse.epsilon.eugenia.GenerateAllDelegate.generateEMFCode(GenerateAllDelegate.java:227)
	at org.eclipse.epsilon.eugenia.GenerateAllDelegate.runImpl(GenerateAllDelegate.java:121)
	at org.eclipse.epsilon.eugenia.GenerateAllDelegate$1.run(GenerateAllDelegate.java:59)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Re: [Emfatic] Error while importing ecore [message #1066771 is a reply to message #1066769] Thu, 04 July 2013 06:14 Go to previous message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 794
Registered: July 2009
Senior Member
Hi Phil,

As discussed in [1], currently Eugenia only works with self-contained single-package metamodels.

Cheers,
Dimitris

[1] http://www.eclipse.org/forums/index.php/mv/msg/489879/1066770/#msg_1066770
Previous Topic:Support of several editors, based on the same metamodel
Next Topic:Import of ecore
Goto Forum:
  


Current Time: Thu Jul 24 11:25:40 EDT 2014

Powered by FUDForum. Page generated in 0.02015 seconds