THM-MoTE / mope-server

Server process for Modelica | Editor
https://thm-mote.github.io//projects/mope
GNU General Public License v3.0
9 stars 0 forks source link

Support for Java 11 with glassfish-corba #4

Closed CSchoel closed 5 years ago

CSchoel commented 6 years ago

Mo|E currently only works with Java <= 8. In higher Java versions it cannot find the CORBA-classes. In Java 9 and 10 this is probably only a problem with the module system, but in Java 11 the CORBA-api is removed alltogether.

Since I still quite enjoy working with Mo|E, I would suggest that we try to use the glassfish-corba library instead as suggested on stackoverflow.

@njustus , do you think this is possible within a reasonable amount of time?

njustus commented 6 years ago

I think there are essentially 2 problems:

  1. the lack of java 9, 10 support of MoPE
  2. the deprecated CORBA api from version 11 and upwards

Are you using java 11 already? I don't understand their release cycle anymore :thinking: . If you are using java 9/10, then I would try to fix the CORBA-issues for this versions first.

Replacing the corba api isn't that easy. For example: i can't find any (java) documentation for the glassfish-corba project :man_shrugging: .. According to OpenModelica's documentation, they do have a ZeroMQ interface.. Maybe we should switch to this, instead of fixing the CORBA stuff.

I don't know how long it would take to switch to ZeroMQ or glassfish-corba either.. I would prefer ZeroMQ, even though it's more additional work.

(https://github.com/OpenModelica/OMPython/pull/23)

If i should implement this, i can't support Dozentron/Gildamesh/Guardian of Times for a few weeks..

CSchoel commented 6 years ago

I'm currently on Java 11, but I also have old instances of Java 10, 9 and 8 on my machine. For the time being I can manually start the server with the Java 8 VM.

Oracle now only has long term support (for paying customers) for every third java version. Starting with Java 8, the next LTS version is Java 11. Therefore I think it is more meaningful to fully support Java 11 than to release an intermediate version for java 9/10.

Regarding ZeroMQ: I also stumbled upon this framework somewhere in the OpenModelica forums. I think anything would be better than CORBA and so far I have only heard good things about ZeroMQ.

Long story short: I think our long term goal should be to transition to ZeroMQ with support for Java 11. This is not urgent, but it would be nice to have a first prototype in early january 2019, maybe even late december 2018 if there are no major issues with Dozentron/Gildamesh/GoT.

njustus commented 5 years ago

Here a quick update: An initial ZeroMQ client is implemented in our omc-java-api. It's also used in a mope-server branch.

Still some things are missing:

When this is fixed, i am going to release a new version of our omc-java-api.

FYI: I'm a little sick since saturday. Don't know if i'll fix this issues this week.

njustus commented 5 years ago

After some playing around and reading through several forums, i think the not possible in current state -erroris a concurrency issue.. When a thread is interrupted after sending a message and before the server reply handling, the request-reply-cycle is corrupted, resulting in the error..

sending and receiving the reply must be made atomic ;).

EDIT: Yep, I was right. The sending/receiving-pair must not be interrupted :smile: . I've put a lock in front of it.. This is basically what corba internally did.

njustus commented 5 years ago

Everything went faster than expected. I've created a prerelease from the server, that can be tested.

CSchoel commented 5 years ago

Nice! I will test it as soon as possible. :+1:

CSchoel commented 5 years ago

The server version 0.6.5 starts in Java 11, but I ran into other problems #8 , #9.

njustus commented 5 years ago

Going to close this one, because java 11 is working.