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

Command Evaluation Server fails to import in Matlab 2019a #194

Open
ujhelyiz opened this issue Jun 19, 2019 · 5 comments
Open

Command Evaluation Server fails to import in Matlab 2019a #194

ujhelyiz opened this issue Jun 19, 2019 · 5 comments

Comments

@ujhelyiz
Copy link
Member

When trying to import simulink models using Matlab2019a with the latest Massif 0.8.0 CI build, it failed with the following exception:

hu.bme.mit.massif.communication.CommandEvaluationException: Exception occurred while evaluating command!
    at hu.bme.mit.massif.communication.AbstractCommandEvaluator.evaluateCommand(AbstractCommandEvaluator.java:65)
    at hu.bme.mit.massif.communication.AbstractCommandEvaluator.evaluateCommands(AbstractCommandEvaluator.java:264)
    at hu.bme.mit.massif.communication.command.MatlabCommand.execute(MatlabCommand.java:99)
    at hu.bme.mit.massif.simulink.api.adapter.block.DefaultBlockAdapter.process(DefaultBlockAdapter.java:56)
    at hu.bme.mit.massif.simulink.api.Importer.createBlockInstance(Importer.java:934)
    at hu.bme.mit.massif.simulink.api.Importer.createBlock(Importer.java:870)
    at hu.bme.mit.massif.simulink.api.Importer.createBlocksFromTopLevel(Importer.java:804)
    at hu.bme.mit.massif.simulink.api.Importer.traverseAndCreateEMFModel(Importer.java:620)
    at hu.bme.mit.massif.simulink.ui.handlers.ImportModelHandler$1.run(ImportModelHandler.java:196)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: 
5: Error on invoking command in matlab server 
Additional information:
{Number of output arguments=1, Type:=eval, Input arguments=, Command:=ImporterTmpResult(1:end)}
---------------------
Original exception: 
java.rmi.UnmarshalException: error unmarshalling return; nested exception is: 
    java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: com.mathworks.jmi.types.MLArrayRef
    at br.com.embraer.massif.commandevaluation.client.MatlabClient.prepareMatlabRMIException(MatlabClient.java:191)
    at br.com.embraer.massif.commandevaluation.client.MatlabClient.executeEval(MatlabClient.java:215)
    at hu.bme.mit.massif.communication.commandevaluation.MatlabClientAccess.executeEval(MatlabClientAccess.java:38)
    at hu.bme.mit.massif.communication.AbstractCommandEvaluator.dataRetriever(AbstractCommandEvaluator.java:142)
    at hu.bme.mit.massif.communication.AbstractCommandEvaluator.evaluateCommand(AbstractCommandEvaluator.java:58)
    ... 9 more

When looking at the partial model created, the issue comes at the very start. I am also attaching the debug log and the created file for future reference.

massif_080_matlab_2019a.zip

@ujhelyiz
Copy link
Member Author

Most likely this is also caused by the missing massif-functions.m issue first defined in #156 - but I have to check it again.

@thSoft
Copy link
Contributor

thSoft commented Jun 26, 2019

  • Adding massif_functions.m did not fix this
  • Also reproducible with Matlab 2018b

@ujhelyiz
Copy link
Member Author

Makes sense that adding the massif_functions.m to the path does not help, as it is already added to the installation folder (#156 (comment))...

@abelhegedus
Copy link
Member

I found this: https://diffplug.github.io/matconsolectl/javadoc/4.4.2/matlabcontrol/MatlabProxy.html

Function Handles and Non-Built-In Classes
MATLAB function_handles and all non-built-in classes (such as the Map class or user defined classes) are converted to an instance of com.mathworks.jmi.types.MLArrayRef that is not Serializable which prevents it from being transferred to a Java application running outside MATLAB (more information on this can be found in the exception section below).

@abelhegedus
Copy link
Member

44balazs added a commit to 44balazs/massif that referenced this issue Jun 24, 2021
@ujhelyiz ujhelyiz added this to the 0.8.0 milestone Aug 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants