modelserver-glsp-integration: Issue with Model URIs on Windows #214
Replies: 3 comments 1 reply
-
Hi @BeniBianchi! |
Beta Was this translation helpful? Give feedback.
-
Hi @BeniBianchi, |
Beta Was this translation helpful? Give feedback.
-
Hi Nina, Yes, I am simply testing the project-template example of the modelserver-glsp-integration. In my opinion, the main cause is the incorrect handling of paths containing backslashes as separators. The function I presume that is the reason why the same function in the coffee-editor (see the following file) is dealing with the same situation slightly different: If I change the code of that function in the modelserver-glsp-integration according to the coffee-editor, then the modelserver-glsp-integration also properly works on (my) Windows. :-) What do you think? Thanks, |
Beta Was this translation helpful? Give feedback.
-
Hi,
as a start I decided to go with https://github.com/eclipse-emfcloud/modelserver-glsp-integration on Windows (I tried the main branch as well as the 0.8.0.RC05 branch).
I managed to build and start the three server processes (client, glsp, model) - so far so good.
The moment I tried to open the file 'example.tasklist' the model server complained 'Model not found!'.
If I look at the details of the request message in the log, it looks like this:
"INFO ProviderDefaults - GET /api/v2/models?modeluri=c%3A%255CUsers%255C..."
And in the error message in the same log it says:
"ERROR ContextResponse - Model 'file:/c:/%5CUsers%5C...' not found!"
If I play around with the model server by manually using/sending different styles of percent-encodings of the model URI, then it looks like the model server
I found the cause of the problem in the following file of the modelserver-glsp-integration:
plugins/org.eclipse.emfcloud.modelserver.glsp.integration/src/org/eclipse/emfcloud/modelserver/glsp/EMSModelServerAccess.java
If I replace line 69:
by
then createURI does not do any percent-encoding (which is done anyway later by the okhttp3 library), and the model server properly opens the file.
But that workaround just led me to the next problem: it looks like the methods
of the class
do not (properly) work on Windows at all.
So I did two more dirty workarounds:
First, I replaced the already mentioned line 69 by
AND replaced line 73
by
Second, I replaced line 57 of the file
from
to
After those changes I could finally open the diagram in Theia.
I am not sure where the real causes of the problems lie. I hope those workarounds give some hints.
Thanks,
Beni
Beta Was this translation helpful? Give feedback.
All reactions