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
Posted 13.06.2013, 02:49 GMT-4 Interfacing, LiveLink for MATLAB, Studies & Solvers Version 4.3 5 Replies
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
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
Attachments:
5 Replies Last Post 01.10.2014, 23:24 GMT-4