Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

error when running coffee machine example #56

Open
chismxna opened this issue Sep 13, 2017 · 20 comments
Open

error when running coffee machine example #56

chismxna opened this issue Sep 13, 2017 · 20 comments

Comments

@chismxna
Copy link

chismxna commented Sep 13, 2017

Hi there,

I'm currently trying to run your coffee machine example coordinating TFSM and SigPML languages on GEMOC 2.3.0. I have run TFSM and SigPML with their own examples loaded from wizard, respectively, and both or them work well. However, after I added the org.gemoc.sample.bcool.tfsmandsigpml, I couldn't run the coffee machine model in the modeling workbench. It looks like a timemodel called SelectCoffeeSystem.launchCoffeeCoin.launch.timemodel is missing. I didn't find this timemodel in the gemoc-gen folder under this project. The full error message is as following:
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.core.internal.resources.ResourceException: Resource '/org.gemoc.sample.bcool.coffeemachinewithsigpml/gemoc-gen/SelectCoffeeSystem.launchCoffeeCoin.launch.timemodel' does not exist.
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:319)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:278)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:406)
at fr.inria.aoste.timesquare.ccslkernel.model.utils.ResourceLoader.loadResource(ResourceLoader.java:43)
at fr.inria.aoste.timesquare.ccslkernel.model.utils.ResourceLoader.loadResource(ResourceLoader.java:34)
at fr.inria.aoste.timesquare.ccslkernel.model.utils.ResourceLoader.loadResource(ResourceLoader.java:38)
at org.gemoc.execution.engine.coordinator.commons.HeterogeneousEngine.(HeterogeneousEngine.java:126)
at org.gemoc.gemoc_heterogeneous_modeling_workbench.ui.launcher.Launcher.launch(Launcher.java:86)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:885)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:739)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1039)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1256)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: org.eclipse.core.internal.resources.ResourceException: Resource '/org.gemoc.sample.bcool.coffeemachinewithsigpml/gemoc-gen/SelectCoffeeSystem.launchCoffeeCoin.launch.timemodel' does not exist.
at org.eclipse.core.internal.resources.Resource.checkExists(Resource.java:335)
at org.eclipse.core.internal.resources.Resource.checkAccessible(Resource.java:209)
at org.eclipse.core.internal.resources.File.getContents(File.java:275)
at org.eclipse.core.internal.resources.File.getContents(File.java:268)
at org.eclipse.emf.ecore.resource.impl.PlatformResourceURIHandlerImpl$WorkbenchHelper.createPlatformResourceInputStream(PlatformResourceURIHandlerImpl.java:207)
at org.eclipse.emf.ecore.resource.impl.PlatformResourceURIHandlerImpl.createInputStream(PlatformResourceURIHandlerImpl.java:525)
at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createInputStream(ExtensibleURIConverterImpl.java:360)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1269)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
... 11 more

I also noticed that in the language workbench, the TfsmAndSigpml.qvto in org.gemoc.sample.bcool.tfsmandsigpml contains errors:

Failed to resolve metamodel 'http://www.eclipse.org/ocl/3.1.0/CompleteOCLCST'
Unrecognized variable: (MM21_seqOfoccursFSMEventContext)
Unrecognized variable: (MM11_seqOfstartAgentAgentContext)
Unrecognized variable: (name)

I tried to flip the EcoreAutoRegister Builder, but it didn't work

Do you have any idea what caused the problem in modeling workbench so that the timemodel wasn't generated? I appreciate your help, thanks!

@zzhang03
Copy link

Do you have any forum to ask questions about using Gemoc? I actually met a lot of problems using it but I don't know what is the proper place to ask questions

@MarcPantel
Copy link

MarcPantel commented Sep 14, 2017 via email

@combemale
Copy link
Contributor

combemale commented Sep 14, 2017 via email

@jdeantoni
Copy link
Contributor

Hi,

thanks for the reporting.
I can reproduce the error and I will provide soon a patch to it.

@jdeantoni
Copy link
Contributor

Hi,
I provided some patches here: http://www.i3s.unice.fr/~deantoni/gemoc2.3.1/toCopyInPluginFor2.3.1.zip
Just unzip the file, copy all the jars in your plugin folder and it should work.

Please tell us if OK.
Note that these corrections will directly be reported on the eclipse version that will be provided by eclipse in few months but we will not make a real official 2.3.1 version :)

@chismxna
Copy link
Author

Hello I added the patches to my plugin folder, SelectCoffeeSystem.launchCoffeeCoin.launch.timemodel is generated now :). However, I still can't run the example. After I click on debug it would automatically stop the engine

*** Model initialization done. (no modelInitialization method defined for the language) ***
*** Engine initialization done. ***
Initialization done, starting engine...
*** Heterogeneous Coordination Engine initialization done. ***
Exception received null, stopping engine.
*** GEMOC Concurrent Engine platform:/resource/org.gemoc.sample.bcool.coffeemachinewithsigpml/models/tfsm_models/coffemachine.xtfsm stopped ***
*** GEMOC Concurrent Engine platform:/resource/org.gemoc.sample.bcool.coffeemachinewithsigpml/models/sigpml_models/SelectCoffeeSystem.xsigpml stopped ***
[trace-SelectCoffeeSystem.xsigpml] 1 states saved to platform:/resource/org.gemoc.sample.bcool.coffeemachinewithsigpml/gemoc-gen/execution/execution-20170918_135243/execution.trace
*** Gemoc engine platform:/resource/ stopped ***

Error log would give me a NullPointerException:
Plug-in: org.gemoc.executionframework.engine
Message: Exception received null, stopping engine.
Exception Stack Trace:
java.lang.NullPointerException
at fr.inria.aoste.timesquare.ccslkernel.runtime.simulation.AbstractStepExecutionEngine.inhibitUnusedClocks(AbstractStepExecutionEngine.java:152)
at fr.inria.aoste.timesquare.ccslkernel.runtime.simulation.AbstractStepExecutionEngine.computePossibleClockStates(AbstractStepExecutionEngine.java:143)
at fr.inria.aoste.timesquare.ccslkernel.solver.CCSLKernelSolver.constructBDD(CCSLKernelSolver.java:647)
at org.gemoc.execution.engine.coordinator.commons.HeterogeneousEngine.computePossibleLogicalSteps(HeterogeneousEngine.java:497)
at org.gemoc.execution.engine.coordinator.commons.HeterogeneousEngine.beforeStart(HeterogeneousEngine.java:623)
at org.gemoc.executionframework.engine.core.AbstractExecutionEngine$1.run(AbstractExecutionEngine.java:296)
at java.lang.Thread.run(Thread.java:745)

Is it like sth should be changed according to the patches?
Looking forward to try 2.3.1 version :)

@chismxna
Copy link
Author

There is one more thing. When I loaded coffee machine models from wizard last week, I immediately got a building workspace error. "Errors running builder 'Xtext Project Builder' on project". I found that SelectCoffeeSystem.aird and SelectCoffeeSystem.xsigpml can't be opened. I had to open the .xsigpml in the text editor, change xmlns:sigpml="http://xsigpml/sigpml/" into xmlns:sigpml="http://org.gemoc.sample.sigpml.xsigpml/sigpml/" manually, then the model diagram could show correctly.

@chismxna
Copy link
Author

@jdeantoni Sorry I found that the SelectCoffeeSystem.launchCoffeeCoin.launch.timemodel wasn't generated correctly. I opened it and it's almost empty. It contains only 2 lines and nothing else:

<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
a TfsmAndSigpml.qvto was also generated along with the timemodels in gemoc-gen folder of org.gemoc.sample.bcool.coffeemachinewithsigpml in model workbench, but it also contains errors. For me it seems that this qvto file is incomplete:
Type of transformation parameter should be model type (for inMM11 and inMM21)
Unrecognized variable: (MM21_seqOfoccursFSMEventContext)
Unrecognized variable: (MM11_seqOfstartAgentAgentContext)
Unrecognized variable: (name)
Cannot find operation (rootObjects()) for the type ()

@jdeantoni
Copy link
Contributor

jdeantoni commented Sep 20, 2017

Hi,

can you please try these things:

  • in the language workbench, right click on the following projects -> configure -> Enable autoEcoreRegister buider
    org.gemoc.sample.tfsm.concurrent.xtfsm
    org.gemoc.sample.sigpml.xsigpml
  • open the following ECL files and be sure that the Metamodels are correctly recognizes, i.e., the first imports should not be erroneous (some errors are presents in "def : if" but not relevant)
    org.gemoc.sample.tfsm.concurrent.moc.dse/ecl/TFSM.ecl
    org.gemoc.sample.sigpml.moc.dse/MocApplication/SigPML.ecl
  • Then, open the bcool file and be sure it is type checking correctly
    org.gemoc.sample.bcool.tfsmandsigpml/operator/TfsmAndSigpml.bcool

At this point, run the modeling workbench, modify the NSUri of the xsigpml file as you already did and go in the debug configuration, choose the coordination configuration and launch the debug.

then, please tell me then what happened :)

thanks
j

@chismxna
Copy link
Author

Hi,
I have enabled EcoreAutoRegister Builder for both projects. There are no errors in ecl files, only a few "The 'OperationCallExp::ArgumentTypeIsConformant' constraint is violated" warnings. Also there are no errors in bcool file. The TfsmAndSigpml.qvto in the language workbench also has no error.
In the model workbench, after I launched debug configuration CoffeeMachinewithSigPML, at first it seems that everything works fine. But after "Model initialization done" "Engine initialization done." and "Heterogeneous Coordination Engine initialization done" are printed in Console, the following message printed in Console is "Exception received null, stopping engine.". In Error Log there is "Exception received null, stopping engine". The error messages are the same as mentioned in my above comment.

There are a lot of warnings saying that "Resource '/org.gemoc.sample.sigpml.moc.lib/MoCLib/SigPML.ccslLib' does not exist." and "Lookup of 'Coincides/Union/Exclusion/Alternates/AgentExecution...' failed". But I checked the language workbench, the file is there.

Other warnings include:
org.eclipse.acceleo.engine.AcceleoEvaluationException: Invalid result for expression self.invoke('org.gemoc.bcool.transformation.bcool2qvto.helper.helperNsURI', 'getEclDocument(org.gemoc.bcool.model.bcool.ImportInterfaceStatement)', Sequence {arg0}) at line 1,088 in Module generate for query getEclDocument(ImportInterfaceStatement). Last recorded value of self was org.gemoc.bcool.model.bcool.impl.ImportInterfaceStatementImpl@1fb931d (name: tfsm) (importURI: platform:/resource/org.gemoc.sample.tfsm.concurrent.moc.dse/ecl/TFSM.ecl). Problem found while generating the file 'C:\GemocBcool\runtime-TestBcool\org.gemoc.sample.bcool.coffeemachinewithsigpml\gemoc-gen\TfsmAndSigpml.qvto'.
at generate.generateElement(BCoolSpecification)(generate.mtl:0)
at generate.generateElement(BCoolSpecification)(generate.mtl:30)
at generate.generateElement(BCoolSpecification)(generate.mtl:28)
at generate.generateElement(BCoolSpecification)(generate.mtl:26)
at generate.generateElement(BCoolSpecification)(generate.mtl:25)
at generate.generateElement(BCoolSpecification)(generate.mtl:17)
at generate.generateElement(BCoolSpecification)(generate.mtl:15)

org.eclipse.acceleo.engine.AcceleoEvaluationException
...
Caused by: org.eclipse.core.internal.resources.ResourceException: Resource '/org.gemoc.sample.sigpml.moc.dse/MoCApplication/SigPML.ecl' does not exist.

org.eclipse.acceleo.engine.AcceleoEvaluationException
...
Caused by: org.eclipse.core.internal.resources.ResourceException: Resource '/org.gemoc.sample.tfsm.concurrent.moc.dse/ecl/TFSM.ecl' does not exist.

org.eclipse.acceleo.engine.AcceleoEvaluationException: Invalid result for expression self.invoke('org.gemoc.bcool.transformation.bcool2qvto.helper.helperNsURI', 'getEclDocument(org.gemoc.bcool.model.bcool.ImportInterfaceStatement)', Sequence {arg0}) at line 1,088 in Module generate for query getEclDocument(ImportInterfaceStatement). Last recorded value of self was org.gemoc.bcool.model.bcool.impl.ImportInterfaceStatementImpl@3c7e9b18 (name: sigpml) (importURI: platform:/resource/org.gemoc.sample.sigpml.moc.dse/MoCApplication/SigPML.ecl). Problem found while generating the file 'C:\GemocBcool\runtime-TestBcool\org.gemoc.sample.bcool.coffeemachinewithsigpml\gemoc-gen\TfsmAndSigpml.qvto'.
at generate.generateElement(BCoolSpecification)(generate.mtl:0)
at generate.generateElement(BCoolSpecification)(generate.mtl:239)
at generate.generateElement(BCoolSpecification)(generate.mtl:236)
at generate.generateElement(BCoolSpecification)(generate.mtl:234)
at generate.generateElement(BCoolSpecification)(generate.mtl:233)
at generate.generateElement(BCoolSpecification)(generate.mtl:17)
at generate.generateElement(BCoolSpecification)(generate.mtl:15)

org.eclipse.ocl.pivot.internal.scoping.EnvironmentView - Lookup of 'tfsm' failed
...
Caused by: org.eclipse.core.internal.resources.ResourceException: Resource '/org.gemoc.sample.tfsm.concurrent.moc.lib/ccsl/TFSMMoC.ccslLib' does not exist.

The files which are claimed 'does not exist' are all in language workbench.
Thank you for your help!

@jdeantoni
Copy link
Contributor

Hi,

the problem is that in the TfsmAndSigpml.qvto generated in the workspace there exists "platform:/resource" links to some resources which are actually in "platform:/plugin".

It should be fixed by the "org.gemoc.bcool.transformation.bcool2qvto_2.3.0.201702201105.jar" plugin.
Did you update it ? Do you have a single plugin named "org.gemoc.bcool.transformation.bcool2qvto_*" ?

On which operating system are you testing ?

As a bad ugly test you can replace the imports of ECL and moccml files in the BCOoL files with "platform:/plugin" (of course the files will not typecheck) as well as the ECLimport from the ecl file.

@chismxna
Copy link
Author

Hi,

My operating system is win7. I had updated the plugins, and used eclipsec.exe -clean to initialize GEMOC, but it seems that "org.gemoc.bcool.transformation.bcool2qvto_2.3.0.201702201105.jar" didn't work as expected. I don't have another "org.gemoc.bcool.transformation.bcool2qvto_*" plugin. The warnings didn't disappear. I could replace "platform:/resource" by "platform:/plugin" manually, and the warnings are gone. However, the "Exception received null, stopping engine." is still there.

@jdeantoni
Copy link
Contributor

jdeantoni commented Sep 25, 2017 via email

@chismxna
Copy link
Author

Hi,

I will try to find what went wrong in bcool2qvto, it may take a while since I'm not familiar with the code. Could you give me some brief directions about how to test it? But if you haven't test GEMOC on win OS, it would be good that you also test the whole thing because there may be other bugs about the bcool engine. Thanks.

@jdeantoni
Copy link
Contributor

Hi Chismxna,

we missunderstood. You do not need to enter in the code. It has been tested with success on win10, java 8_102. However not under win7. The point is that for a strange reason the new plugin bcool2qvto is not loaded by your environment. Importing the bcool2qvto project in your language workbench is a way to force it to load. Perhaps another solution could be to test from a whole new workspace...

I would not ask you to debug the whole bcool engine but you fall under a very bad luck category for now :)

@chismxna
Copy link
Author

Oh I see. Yeah I agree that the situation is weird, I loaded the project into my workspace but still no help.

@dvojtise
Copy link
Contributor

Hi
may be you can check in the error log and in the plugin view why the plugin has not started on win7 ?

open the plugin registry view, right click enable the advanced options, then search the plugin you are interrested in (by scrolling because the search by text doesn't work well)
a check will consist of : right click and diagnose + start, it may trigger error in the error log view or consoles console that may help understand the issue.

@chismxna
Copy link
Author

Hi dvojtise,

It's very strange because Diagnosis shows that "No problem detected." I begin to doubt that whether the problem really lies in bcool2qvto plugin.

@dvojtise
Copy link
Contributor

dvojtise commented Sep 26, 2017

Diagnosis is not enough, you also need to force a start (that may trigger other errors)
Otherwise, then try to start all gemoc related plugin in this view (org.gemoc.* , timesquare, melange and k3, diverse.commons) (until they all get the green "play" arrow ) to see if one of them fails (this is usually what I do to diagnose configuration problem)
I would suggested to start by timesquare.* which contains native binaries. (also start by plugin with name ending with .ui because they are at the end of the dependency chain and will start required plugins automatically)
Some plugins may have some requirement on the platform (os, 32/64 etc) that prevent one to start.
I know that the configuration has changed a bit due to windows 7 and windows 10 way to report themselve using java properties.
(the problem with eclipse is that when launching the workspace such error is usually hidden to the end user, the "plugin registry view" method helps to track them down)

@chismxna
Copy link
Author

Hi dvojtise,

I have tried to start all gemoc related plugins, but I didn't get any errors. I will be away from campus for a week so I won't be able to test it on Win7. I would be grateful if you could do the testing.

I tried to execute coffemachine.xtfsm and SelectCoffeeSystem.xsigpml, respectively. I did this by using debug configuration CoffeeCoin and SelectCoffeeSystem under Gemoc Concurrent eXecutable Model category. I found that SelectCoffeeSystem worked fine, but CoffeeCoin cannot start correctly. Although it didn't give me the warnings in the earlier posts, it gave me the following:

  1. Please verify that you don't have the modeling nature for your project so that the aird indexed all the resources, (it must not contain resolve warning).
    2.There are unresolved proxies in platform:/resource/org.gemoc.sample.bcool.coffeemachinewithsigpml/gemoc-gen/coffemachine.timemodel, the first is org.eclipse.emf.ecore.impl.EPackageImpl@215051e0 (eProxyURI: platform:/plugin/org.gemoc.sample.tfsm.concurrent.xtfsm/model/tfsm.ecore#/)=[[org.eclipse.emf.ecore.impl.EPackageImpl@215051e0 (eProxyURI: platform:/plugin/org.gemoc.sample.tfsm.concurrent.xtfsm/model/tfsm.ecore#/)]]
  2. Unable to initialize part: java.lang.NullPointerException

Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants