Closed maederan201 closed 1 year ago
Turns out, the tests fail on Windows with com.comsol.util.exceptions.FlException: Not connected to a server
. So this doesn't solve all the problems. But I'll probably merge this anyway and "fix it in post" if my hunch is correct.
What I think this all means is:
plugins
folder on the class path, as mentioned in the Comsol documentation, namely in the Programming Manual, when we run a "stand-alone" client. Which is the (MPh) default on Windows, and also what you'd do on other platforms when developing a Java-based application that uses Comsol as a compute back-end.apiplugins
folder on the class path for the "thin" client in client–server mode, which is the (MPh) default on Linux and macOS. This requirement is never mentioned anywhere in the Comsol documentation, for all I can tell, but that may just be because there's little reason to use client–server mode for application development. So it's a rare use case. For MPh, however, we have no other choice. Or rather, very little choice, as stand-alone clients started from Python via JPype would not work out of the box, and thus degrade the user experience. (Technical details are laid out in #8.) Even the naming makes sense now, since the thin client communicates with the server via a network socket, so only needs to know that internal "API".I guess the eventual solution would be to load the Java libraries from either the plugins
or the apiplugins
folder, depending on which type of client we're instantiating.
I won't pretend I fully understood the reasons. However, I included different classpaths depending on whether its a standalone client or not. Again for me on Linux it works and all tests pass.
Idk if there is a more elegant solutions but it might work platform independent.
Tested, merged, and released. Thank you for your contribution!
I am sorry that my computer knowledge may be limited and I did not understand your conversation. I would like to use MPH on a Linux server. How can I set the path? Is there a complete reference document available? The description page for adding path links in the Docs document is no longer valid. I really hope to receive your help! @john-hen
This PR implements a change required to fix #114 (at least on my system). The classpath is changed from
plugins
toapiplugins
.All the tests in
tools/test.py
complete successfully after this. Needs to be verified that it works on other OS as well.