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.

java.lang.ClassCastException when using LiveLink from MATLAB

Please login with a confirmed email address before reporting spam

Hi there,

I've been successfully using COMSOL and LiveLink for a few months now for generating and simulating electromagnetic models.
However, yesterday I ran the same MATLAB code as I always do, but with a different COMSOL mph-file and I got the following error:

=====================
Error using generateSyntheticData (line 76)
Java exception occurred:
Exception:
java.lang.ClassCastException: java.lang.Object cannot be cast to java.lang.String
(rethrown as com.comsol.util.exceptions.FlException)
(rethrown as com.comsol.util.exceptions.FlException)
(rethrown as com.comsol.util.exceptions.FlException)
Messages:
The following feature has encountered a problem

The following feature has encountered a problem

Error in multiphysics compilation
- Feature: Compile Equations: Stationary (sol1/st1)
- Error: Error in multiphysics compilation.

Stack trace:
at org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl$25.copyValue(CDOTypeImpl.java:585)
...
=====================

The error occurs when the MATLAB line

model.sol('sol1').runAll;

is executed (see attached file generateSyntheticData.m). Can anybody tell me, what the problem is here?
The same code works with many other, almost identical, mph-files that even use finer meshes. So a memory problem is unlikely.
Also the generated/modified mph-file can be simulated/computed perfectly fine in COMSOL itself. Only when being simulated via MATLAB/LiveLink the error occurs. Another strange thing is that just before the above line of code the command

model.sol('sol1').clearSolution;

is successfully executed. So it's not an error in the tag-String 'sol1' either.

I would appreciate any help, because I'm really stuck due to this error. :(

Thanks a lot in advance,
Joerg




5 Replies Last Post 2014年10月1日 GMT-4 23:24

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2013年6月17日 GMT-4 13:09
Does nobody have any idea what this could be related to?
Does nobody have any idea what this could be related to?

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2013年8月21日 GMT-4 15:19
Joerg,

I am having the same issue. Did you every find a solution?

Thank you,

Curtis
Joerg, I am having the same issue. Did you every find a solution? Thank you, Curtis

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2013年8月26日 GMT-4 13:07
Joerg,

I don't know if you ever found a solution to your problem, but I was able to solve mine by downgrading to 4.3a. It looks like something in update 1 for 4.3b broke my simulation. I noticed that the example scatterer_on_substrate also doesn't run (uses the same basic simulation setup that I use).

Hope this helps.

Curtis
Joerg, I don't know if you ever found a solution to your problem, but I was able to solve mine by downgrading to 4.3a. It looks like something in update 1 for 4.3b broke my simulation. I noticed that the example scatterer_on_substrate also doesn't run (uses the same basic simulation setup that I use). Hope this helps. Curtis

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2013年8月28日 GMT-4 16:03
Hey Curtis,

thanks for your feedback. No, I was not able to solve that problem. So I eventually dropped using COMSOL and implemented my own 3D-FEM methods in MATLAB for my project. LiveLink just wouldn't work anymore.

Maybe COMSOL support reads your post and has a look into the last updates in order to find out what wen wrong.

Thanks again for your valuable imput,
Joerg
Hey Curtis, thanks for your feedback. No, I was not able to solve that problem. So I eventually dropped using COMSOL and implemented my own 3D-FEM methods in MATLAB for my project. LiveLink just wouldn't work anymore. Maybe COMSOL support reads your post and has a look into the last updates in order to find out what wen wrong. Thanks again for your valuable imput, Joerg

Please login with a confirmed email address before reporting spam

Posted: 10 years ago 2014年10月1日 GMT-4 23:24
Dear Joerg

I also received the exact error and just like you, I used 4.3a and my problem is solved.

Thanks for the comment,
Hossein


Joerg,

I don't know if you ever found a solution to your problem, but I was able to solve mine by downgrading to 4.3a. It looks like something in update 1 for 4.3b broke my simulation. I noticed that the example scatterer_on_substrate also doesn't run (uses the same basic simulation setup that I use).

Hope this helps.

Curtis


Dear Joerg I also received the exact error and just like you, I used 4.3a and my problem is solved. Thanks for the comment, Hossein [QUOTE] Joerg, I don't know if you ever found a solution to your problem, but I was able to solve mine by downgrading to 4.3a. It looks like something in update 1 for 4.3b broke my simulation. I noticed that the example scatterer_on_substrate also doesn't run (uses the same basic simulation setup that I use). Hope this helps. Curtis [/QUOTE]

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.