Discussion Locked This discussion was locked by a forum moderator.

Prevent server from closing upon disconnect in java API

Please login with a confirmed email address before reporting spam

I am building a program in java that runs a COMSOL model in server mode. This program is executed multiple times by another external program and java needs to terminate each time. As such, I need to connect to and disconnect from the COMSOL server repeatedly. My issue is that the server window closes when either of these two commands are executed in java: ModelUtil.disconnect(); System.exit(0);

I could potentially tell the external program to restart a COMSOL server instance before running the java program each time, but surely there is a way to ensure the server stays open once I have disconnected from it.

I'm sure I am missing something very simple, but can't find the answer in the manual. Thanks for any help!


1 Reply Last Post Jul 13, 2018, 10:28 a.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 6 years ago Jul 13, 2018, 10:28 a.m. EDT

Figured it out.

FYI for anyone using Windows who encounters this issue...

Start the server with this command (or similar) in a Command Prompt: "C:\Program Files\COMSOL\COMSOL53\Multiphysics\bin\win64\comsolmphserver.exe" -multi on

Figured it out. FYI for anyone using Windows who encounters this issue... Start the server with this command (or similar) in a Command Prompt: **"C:\Program Files\COMSOL\COMSOL53\Multiphysics\bin\win64\comsolmphserver.exe" -multi on**

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.