Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change classpath to apiplugins fixing #114 #115

Merged
merged 3 commits into from
Feb 10, 2023

Conversation

maederan201
Copy link
Contributor

@maederan201 maederan201 commented Feb 8, 2023

This PR implements a change required to fix #114 (at least on my system). The classpath is changed from plugins to apiplugins.

All the tests in tools/test.py complete successfully after this. Needs to be verified that it works on other OS as well.

@maederan201 maederan201 changed the title Change classpath to apiplugins fixing #104 Change classpath to apiplugins fixing #114 Feb 8, 2023
@john-hen
Copy link
Collaborator

john-hen commented Feb 8, 2023

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:

  • We need the Java libraries from the 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.
  • But we need the Java libraries from the 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 Limited support for stand-alone clients on Linux/macOS #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.

@maederan201
Copy link
Contributor Author

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.

@john-hen john-hen merged commit 6e3fdbe into MPh-py:main Feb 10, 2023
@john-hen
Copy link
Collaborator

Tested, merged, and released. Thank you for your contribution!

@qup20

This comment was marked as off-topic.

@MPh-py MPh-py locked and limited conversation to collaborators Nov 22, 2023
@john-hen john-hen removed the merged label Jun 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Connect failure with Comsol 6.1 on Linux
3 participants