Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

help: connection error with matlab livelink

Please login with a confirmed email address before reporting spam

I'm trying to get the matlab livelink to work, but no matter what I do I always get the same error:
I launch "Comsol with Matlab", the console opens, then Matlab opens, and the following error is displayed within Matlab:

??? Java exception occurred:
com.comsol.model.clientserver.ConnectionAbortedException
at com.comsol.model.clientserver.ClientManagerImpl.a(Unknown Source)
at com.comsol.model.clientserver.ClientManagerImpl.connect(Unknown Source)
at com.comsol.model.util.ModelManager.connect(Unknown Source)
at com.comsol.model.util.ModelManager.connect(Unknown Source)
at com.comsol.model.util.ModelUtil.connect(Unknown Source)

Someone on the supporrt team suggested that I run the comsol server and the comsol client to see if a connection can be made. When I do that, the server opens up fine and listens on port 2036. Then I start the client and enter the port number, my username and password. When I click OK, the connection times out every time.

Note that I'm doing all this with the latest version of COMSOL and the latest hotfixes, and my firewall is off. I am running Windows Vista 32bit, Comsol 4.0a, Matlab 2009b.

I've reinstalled both Matlab and COMSOL numerous times already, and always get the same error.

The path to Matlab is setup correctly in the ini files.

I'd appreciate any ideas! Thanks.

3 Replies Last Post Sep 27, 2012, 12:45 p.m. EDT
COMSOL Moderator

Hello Mandy Philippine

Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.

If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.


Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Oct 25, 2011, 1:47 p.m. EDT
I am having the exact same problem with COMSOL 4.2 and Matlab 2010b. my server also listens on port 2036 and also times out. did you or anyone else figure this out? thanks!
I am having the exact same problem with COMSOL 4.2 and Matlab 2010b. my server also listens on port 2036 and also times out. did you or anyone else figure this out? thanks!

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Oct 25, 2011, 1:56 p.m. EDT
p.s: I'm using Linux Red Hat 6.1 workstation, 64 bit
p.s: I'm using Linux Red Hat 6.1 workstation, 64 bit

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Sep 27, 2012, 12:45 p.m. EDT
Hi,
this problem seems to occur sometimes when the OS and the software 'do not match'. For example Comsol 4.3 and Matlab r2012a worked together fine on Linux Mint 12, but after upgrading to Linux Mint 13 (based on Ubuntu 12.04 LTS) the 'comsol server matlab' command produces this strange error. I do not know why it happens but I figured out two ways to make it work for me:

1) If you got superuser rights on your machine, try 'sudo comsol server matlab'. I know this is not always possible and also not very nice, so I prefer the second method...

2) Connect Matlab manually to a Comsol instance running in server mode:
- start Comsol in server mode 'comsol server'
- start Matlab
- in Matlab add the path of the mli directory, e.g.: addpath('/usr/local/comsol-4.3/mli');
- then connect to Comsol (and import the libraries for setting up Comsol models):
mphstart;
import com.comsol.model.*;
import com.comsol.model.util.*;

Both methods worked for me - for method 2) I've wrote myself a little batch script to start Comsol connected to Matlab.
Hi, this problem seems to occur sometimes when the OS and the software 'do not match'. For example Comsol 4.3 and Matlab r2012a worked together fine on Linux Mint 12, but after upgrading to Linux Mint 13 (based on Ubuntu 12.04 LTS) the 'comsol server matlab' command produces this strange error. I do not know why it happens but I figured out two ways to make it work for me: 1) If you got superuser rights on your machine, try 'sudo comsol server matlab'. I know this is not always possible and also not very nice, so I prefer the second method... 2) Connect Matlab manually to a Comsol instance running in server mode: - start Comsol in server mode 'comsol server' - start Matlab - in Matlab add the path of the mli directory, e.g.: addpath('/usr/local/comsol-4.3/mli'); - then connect to Comsol (and import the libraries for setting up Comsol models): mphstart; import com.comsol.model.*; import com.comsol.model.util.*; Both methods worked for me - for method 2) I've wrote myself a little batch script to start Comsol connected to Matlab.

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.