eclipse-emfcloud / ecore-glsp

ecore-glsp
Other
32 stars 25 forks source link

[ModelServer] Creating a new diagram no longer works #97

Closed CamilleLetavernier closed 3 years ago

CamilleLetavernier commented 3 years ago

When opening an .ecore model without a corresponding .enotation model, the Diagram (enotation) was automatically created, populated with existing Ecore elements, and auto-layouted. This no longer works on the current model server branch (I'm not sure when it stopped working). Instead, it causes an exception:

Error during model loading
org.eclipse.glsp.server.protocol.GLSPServerException: Error during model loading
    at org.eclipse.emfcloud.ecore.glsp.model.EcoreModelServerAccess.getNotationModel(EcoreModelServerAccess.java:116)
    at org.eclipse.emfcloud.ecore.glsp.ResourceManager.createEcoreFacade(ResourceManager.java:87)
    at org.eclipse.emfcloud.ecore.glsp.ResourceManager.<init>(ResourceManager.java:62)
    at org.eclipse.emfcloud.ecore.glsp.EcoreEditorContext.<init>(EcoreEditorContext.java:25)
    at org.eclipse.emfcloud.ecore.glsp.model.EcoreModelFactory.loadModel(EcoreModelFactory.java:70)
    at org.eclipse.glsp.server.actions.RequestModelActionHandler.executeAction(RequestModelActionHandler.java:35)
    at org.eclipse.glsp.server.actions.RequestModelActionHandler.executeAction(RequestModelActionHandler.java:1)
    at org.eclipse.glsp.server.actions.BasicActionHandler.execute(BasicActionHandler.java:45)
    at org.eclipse.glsp.server.internal.action.DefaultActionDispatcher.runAction(DefaultActionDispatcher.java:206)
    at org.eclipse.glsp.server.internal.action.DefaultActionDispatcher.handleMessage(DefaultActionDispatcher.java:179)
    at org.eclipse.glsp.server.internal.action.DefaultActionDispatcher.handleNextMessage(DefaultActionDispatcher.java:164)
    at org.eclipse.glsp.server.internal.action.DefaultActionDispatcher.runThread(DefaultActionDispatcher.java:151)
    at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.util.concurrent.ExecutionException: java.lang.RuntimeException: Could not parse 'data' field
    at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
    at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1999)
    at org.eclipse.emfcloud.ecore.glsp.model.EcoreModelServerAccess.getNotationModel(EcoreModelServerAccess.java:113)
    ... 12 more
Caused by: java.lang.RuntimeException: Could not parse 'data' field
    at org.eclipse.emfcloud.modelserver.client.ModelServerClient.lambda$28(ModelServerClient.java:734)
    at java.base/java.util.Optional.orElseThrow(Optional.java:408)
    at org.eclipse.emfcloud.modelserver.client.ModelServerClient.require(ModelServerClient.java:734)
    at java.base/java.util.function.Function.lambda$andThen$1(Function.java:88)
    at org.eclipse.emfcloud.modelserver.client.Response.body(Response.java:39)
    at org.eclipse.emfcloud.ecore.glsp.model.EcoreModelServerAccess.lambda$1(EcoreModelServerAccess.java:113)
    at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642)
    at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
    at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2073)
    at org.eclipse.emfcloud.modelserver.client.ModelServerClient$2.onResponse(ModelServerClient.java:697)
    at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    ... 1 more