HEADS-project / training

Training material to get started with the HEADS technologies
10 stars 16 forks source link

Issues when manipulating ThingML #118

Closed jobs10000 closed 7 years ago

jobs10000 commented 7 years ago

When I was running the project provided at https://github.com/HEADS-project/training/tree/79d92e02eaee41a548dd7ee3448ccc6b9642cc6e/1.ThingML_Basics/7.ReadThingMLModel, I encountered the following problem.

Loading input file: C:\GenerateThingML\models\Basics\Timer\PingPong.thingml... org/antlr/runtime3_4_0/Lexer java.lang.NoClassDefFoundError: org/antlr/runtime3_4_0/Lexer at org.sintef.thingml.resource.thingml.mopp.ThingmlResource.(ThingmlResource.java:166) at org.sintef.thingml.resource.thingml.mopp.ThingmlResourceFactory.createResource(ThingmlResourceFactory.java:25) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.createResource(ResourceSetImpl.java:425) at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.createResource(ResourceSetImpl.java:414) at ReadThingML.main(ReadThingML.java:33) Caused by: java.lang.ClassNotFoundException: org.antlr.runtime3_4_0.Lexer at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 5 more

I didn't use maven here (because I have to build my own project from scratch), but I have included all the jar file needed (including org.sintef.thingml.resource.thingml_0.7.0.201612211920.jar and org.sintef.thingml.model_0.7.0.201612211920 .jar in my project.

Do you have any idea how to fix that problem?

Platform: Windows 10 & Eclipse

brice-morin commented 7 years ago

You probably forgot to include the JAR file for ANTLR 3.4.0, since a class belonging to ANTLR cannot be found.

jobs10000 commented 7 years ago

It still doesn't work. The following is a snapshot of my project. I guess, the jar does not matter, right?

Do you have idea how to save ThingML as XML instead of using meta model?

jobs10000 commented 7 years ago

issue

The above is a screenshot of my eclipse project.

brice-morin commented 7 years ago

This JAR contains all dependencies.

Also, all the helper function, such as allStates or allThings have been changed. Look in those files

jobs10000 commented 7 years ago

Would you mind giving a little more explanation on how to work on that (extracting ThingML elements)? What is ThingMLElement self, Configuration self and etc? What kind of parameter am I supposed to pass? If possible, could you please rewrite the program provided at here https://github.com/HEADS-project/training/tree/79d92e02eaee41a548dd7ee3448ccc6b9642cc6e/1.ThingML_Basics/7.ReadThingMLModel? I am really interested in working on that, because someone here at my university has published a paper on that? Thanks a lot!