Can not instantiate EmfModel [message #1754519] |
Sun, 19 February 2017 07:13  |
Eclipse User |
|
|
|
Hello,
i want to start an egl file from Java with an emf model.
But I have an exception at EmfModel():
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/emf/ecore/EClassifier
at StartEGL.main(StartEGL.java:35)
Caused by: java.lang.ClassNotFoundException: org.eclipse.emf.ecore.EClassifier
EglFileGeneratingTemplateFactory eglTemplateFactory = new EglFileGeneratingTemplateFactory();
IEolExecutableModule module = new EglTemplateFactoryModuleAdapter(eglTemplateFactory);
eglTemplateFactory.setOutputRoot("model/calender.html");
module.parse(new File("model/Calender2HTML.egl").getAbsoluteFile());
EmfModel model = new EmfModel();
How can i do this at the right way?
Thanks.
|
|
|
|
Re: Can not instantiate EmfModel [message #1754712 is a reply to message #1754519] |
Tue, 21 February 2017 12:34   |
Eclipse User |
|
|
|
Okay, now I can instantiate my EmfModel 
But no output is generated. Here is my Code:
EglFileGeneratingTemplateFactory eglTemplateFactory = new EglFileGeneratingTemplateFactory();
IEolExecutableModule module = new EglTemplateFactoryModuleAdapter(eglTemplateFactory);
eglTemplateFactory.setOutputRoot("model/calender.html");
module.parse(new File("model/Calender2HTML.egl").getAbsoluteFile());
EmfModel model = new EmfModel();
StringProperties properties = new StringProperties();
properties.put(EmfModel.PROPERTY_NAME, "Mein Kalender");
properties.put(EmfModel.PROPERTY_FILE_BASED_METAMODEL_URI, "model/Calender.ecore");//"file:/" + new File(metamodel).getAbsolutePath());
properties.put(EmfModel.PROPERTY_MODEL_URI, "file:/" + new File("model/My.Calender").getAbsolutePath());
properties.put(EmfModel.PROPERTY_IS_METAMODEL_FILE_BASED, "true");
properties.put(EmfModel.PROPERTY_READONLOAD, true + "");
properties.put(EmfModel.PROPERTY_STOREONDISPOSAL, true + "");
model.load(properties, (IRelativePathResolver) null);
eglTemplateFactory.getContext().getModelRepository().addModel(model) ;
module.execute();
module.getContext().getModelRepository().dispose();
Regards,
Roemer
|
|
|
|
Powered by
FUDForum. Page generated in 0.04080 seconds