ContextMapper / web-ide-demo

Context Mapper Demo for Online IDE (Gitpod)
https://contextmapper.org/
Apache License 2.0
3 stars 54 forks source link

`Internal error: does not contain a CML model` #4

Closed JosephDenman closed 1 year ago

JosephDenman commented 1 year ago

Using the web IDE, I add a file test/test.cml containing the text:

Domain Insurance {}

UserStory US1_Example {
  As an "Insurance Employee" I want to "create" a "Customer" so that "I am able to manage customer data ..."
}

UseCase UC1_Example {
  actor = "Insurance Employee"
  interactions = "create" a "Customer"
  benefit = "I am able to manage customer data ..."
}

In the console OUTPUT tab, I see the following error:

Picked up JAVA_TOOL_OPTIONS:  -Xmx3489m
Warning: Nashorn engine is planned to be removed from a future JDK release
Apr 17, 2023 10:26:17 AM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint fallbackResponseError
SEVERE: Internal error: org.contextmapper.dsl.cml.exception.ResourceIsNoCMLModelException: The resource 'file:///workspace/web-ide-demo/src/main/cml/test/test.cml' does not contain a CML model.
java.util.concurrent.CompletionException: org.contextmapper.dsl.cml.exception.ResourceIsNoCMLModelException: The resource 'file:///workspace/web-ide-demo/src/main/cml/test/test.cml' does not contain a CML model.
    at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:331)
    at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:346)
    at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:704)
    at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
    at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2088)
    at org.eclipse.xtext.ide.server.concurrent.AbstractRequest.logAndCompleteExceptionally(AbstractRequest.java:73)
    at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$doRun$0(ReadRequest.java:69)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: org.contextmapper.dsl.cml.exception.ResourceIsNoCMLModelException: The resource 'file:///workspace/web-ide-demo/src/main/cml/test/test.cml' does not contain a CML model.
    at org.contextmapper.dsl.cml.CMLResource.throwResourceIsNoCMLModelException(CMLResource.java:68)
    at org.contextmapper.dsl.cml.CMLResource.<init>(CMLResource.java:52)
    at org.contextmapper.dsl.ide.actions.CMLActionService.getActions(CMLActionService.java:61)
    at org.contextmapper.dsl.ide.actions.CMLActionService.lambda$getCodeActions$0(CMLActionService.java:50)
    at org.eclipse.xtext.ide.server.LanguageServerImpl$1.lambda$doSyncRead$3(LanguageServerImpl.java:1169)
    at org.eclipse.xtext.ide.server.WorkspaceManager.doRead(WorkspaceManager.java:458)
    at org.eclipse.xtext.ide.server.LanguageServerImpl$1.doSyncRead(LanguageServerImpl.java:1168)
    at org.contextmapper.dsl.ide.actions.CMLActionService.getCodeActions(CMLActionService.java:52)
    at org.eclipse.xtext.ide.server.LanguageServerImpl.codeAction(LanguageServerImpl.java:798)
    at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$codeAction$37(LanguageServerImpl.java:779)
    at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$doRun$0(ReadRequest.java:66)
    ... 5 more

[Error - 10:26:17 AM] Request textDocument/codeAction failed.
  Message: Internal error.
  Code: -32603 
java.util.concurrent.CompletionException: org.contextmapper.dsl.cml.exception.ResourceIsNoCMLModelException: The resource 'file:///workspace/web-ide-demo/src/main/cml/test/test.cml' does not contain a CML model.
    at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:331)
    at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:346)
    at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:704)
    at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
    at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2088)
    at org.eclipse.xtext.ide.server.concurrent.AbstractRequest.logAndCompleteExceptionally(AbstractRequest.java:73)
    at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$doRun$0(ReadRequest.java:69)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: org.contextmapper.dsl.cml.exception.ResourceIsNoCMLModelException: The resource 'file:///workspace/web-ide-demo/src/main/cml/test/test.cml' does not contain a CML model.
    at org.contextmapper.dsl.cml.CMLResource.throwResourceIsNoCMLModelException(CMLResource.java:68)
    at org.contextmapper.dsl.cml.CMLResource.<init>(CMLResource.java:52)
    at org.contextmapper.dsl.ide.actions.CMLActionService.getActions(CMLActionService.java:61)
    at org.contextmapper.dsl.ide.actions.CMLActionService.lambda$getCodeActions$0(CMLActionService.java:50)
    at org.eclipse.xtext.ide.server.LanguageServerImpl$1.lambda$doSyncRead$3(LanguageServerImpl.java:1169)
    at org.eclipse.xtext.ide.server.WorkspaceManager.doRead(WorkspaceManager.java:458)
    at org.eclipse.xtext.ide.server.LanguageServerImpl$1.doSyncRead(LanguageServerImpl.java:1168)
    at org.contextmapper.dsl.ide.actions.CMLActionService.getCodeActions(CMLActionService.java:52)
    at org.eclipse.xtext.ide.server.LanguageServerImpl.codeAction(LanguageServerImpl.java:798)
    at org.eclipse.xtext.ide.server.LanguageServerImpl.lambda$codeAction$37(LanguageServerImpl.java:779)
    at org.eclipse.xtext.ide.server.concurrent.ReadRequest.lambda$doRun$0(ReadRequest.java:66)
    ... 5 more

Coincidentally, or not, highlighting the stories and use-cases and right clicking does not display an option for deriving subdomains as described here.

My local environment is:

iMac-Pro:~ josephdenman$ sw_vers
ProductName:        macOS
ProductVersion:     13.2.1
BuildVersion:       22D68
iMac-Pro:~ josephdenman$ uname
Darwin
iMac-Pro:~ josephdenman$ java --version
openjdk 19.0.2 2023-01-17
OpenJDK Runtime Environment Temurin-19.0.2+7 (build 19.0.2+7)
OpenJDK 64-Bit Server VM Temurin-19.0.2+7 (build 19.0.2+7, mixed mode, sharing)
stefan-ka commented 1 year ago

Hi @JosephDenman

That is very weird. When I open the web IDE and do the same, everything works perfectly fine for me.

I created test/test.cml and copied your example. Then I get the light bulb suggesting the action when I have the cursor at the user story or select it:

image

... and when I click on it, I get the suggested action:

image

Which I can then also successfully execute:

image

How did you start the Web IDE (Gitpod)? With this link? https://gitpod.io/#https://github.com/ContextMapper/web-ide-demo

Best regards, Stefan

JosephDenman commented 1 year ago

I didn't see the lightbulb! The documentation says I should look for the option in the right-click menu 😁

stefan-ka commented 1 year ago

@JosephDenman

Oh, okay, sorry for that! Good point, the documentation is still kind of Eclipse-oriented... Probably we should update this because most users work with VS Code today :)