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

Exception while import and export; export only partially #35

Open
yvec opened this issue Jul 31, 2015 · 5 comments
Open

Exception while import and export; export only partially #35

yvec opened this issue Jul 31, 2015 · 5 comments
Assignees
Labels
Milestone

Comments

@yvec
Copy link

yvec commented Jul 31, 2015

Hi,
I have a two issues with import and export of models, which are:

  1. When importing or exporting a model, the Matlab instance keeps showing those exceptions, while the resulting .simulink-file fully reflects the original .slx-model:

Reconnecting to this session of MATLAB will not be possible
matlabcontrol.MatlabConnectionException: Could not register this session of MATLAB
at matlabcontrol.MatlabBroadcaster.bindSession(MatlabBroadcaster.java:144)
at matlabcontrol.MatlabBroadcaster.broadcast(MatlabBroadcaster.java:92)
at matlabcontrol.MatlabConnector$EstablishConnectionRunnable.run(MatlabConnector.java:189)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is:
java.net.SocketException: Connection reset
at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
at sun.rmi.server.UnicastRef.newCall(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
at matlabcontrol.MatlabBroadcaster.bindSession(MatlabBroadcaster.java:140)
... 8 more
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at java.io.DataInputStream.readByte(Unknown Source)
... 13 more
Connection to Java application could not be established
java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
java.net.ConnectException: Connection refused: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
at sun.rmi.server.UnicastRef.newCall(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at matlabcontrol.MatlabConnector$EstablishConnectionRunnable.run(MatlabConnector.java:205)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.(Unknown Source)
at java.net.Socket.(Unknown Source)
at javax.net.DefaultSocketFactory.createSocket(Unknown Source)
at matlabcontrol.LocalHostRMIHelper$LocalHostRMISocketFactory.createSocket(LocalHostRMIHelper.java:71)
... 12 more

  1. When exporting, the .simulink model (which was transformed from a .slx-file using massif) is only transformed partially, so that the resulting .mdl-file or .slx-file only shows a fraction of the elements of the original model. For any other manually created .simulink-file, the export does not proceed at all after throwing the exceptions.

I have installed those:
Eclipse Modeling Tools Luna
Incquery 0.8.1 (installed from manually downloaded local package)
Xtext 2.6
Massif 0.5
Matlab R2014b

I would be grateful for any kind of help! Thanks!

@imbur
Copy link
Member

imbur commented Jul 31, 2015

Hi!
The exceptions shown on the Matlab console are only present when you are using matlabcontrol. It would be possible to reconnect a running Matlab session, however, we did not go any deeper into matlabcontrol configuration and setup details to support this, so I assume that's why there is an exception.
The about the second part of your problem: upon export make sure the original models are not on the Matlab path. There might be a problem with name collision.
Also, it would be interesting to see whether you experience the same behavior using the other Matlab connector (Command Evaluation Server)?

@abelhegedus
Copy link
Member

Hi!

Concerning your installed versions:

Incquery 0.8.1 (installed from manually downloaded local package)
Xtext 2.6
Massif 0.5

The current version in master (0.5.0, but not a release) is compatible with EMF-IncQuery 1.0.0 (which requires Xtext 2.8.x). I have updated the user guide to remove the outdated EMF-IncQuery version requirement.

@yvec
Copy link
Author

yvec commented Aug 3, 2015

Hi!

Thanks a lot for the helpful replies!

I used the Command Evaluation Server and massif now converts the models without exceptions, but there seems to be a problem with the conversion process:
When trying to convert a demo model provided by Matlab (C:\Program Files\MATLAB\R2014b\toolbox\sldo\sldodemos\estim\sdoRCCircuit.slx) to .simulink-file ("referencing", "flattening"), then convert back to .slx- or .mdl-file, the "connections" are not fully represented. I would like to ask if this is an error induced by wrong installation/use or a known error.

Thanks very much!
Yve

@imbur
Copy link
Member

imbur commented Aug 3, 2015

Hi!
The reason is the following: some of the blocks (like 'sdoRCCircuit/V1 5V DC') have LConn and RConn ports, which port types are not supported currently.
Here you can find the current port provider. It supports now only 4 basic port types. Also, here is the part of the importer that deals with the ports. State ports have some support too, but LConn and RConn are not implemented yet.
So, all in all, I can say it is a missing feature and now this is the expected behavior. Of course, if you didn't receive any logging about this within Eclipse, then we would be very happy if you could file an issue to indicate this defect.
Best regards,
Marton

@yvec
Copy link
Author

yvec commented Aug 4, 2015

Hi Marton,
thanks a lot for the explanation!
I found out that in the first run, eclipse does through exceptions:

hu.bme.mit.massif.communication.CommandEvaluationException: Exception occurred while evaluating command!
    at hu.bme.mit.massif.communication.commandevaluation.CommandEvaluatorImpl.evaluateCommand(CommandEvaluatorImpl.java:91)
    at hu.bme.mit.massif.communication.commandevaluation.CommandEvaluatorImpl.evaluateCommands(CommandEvaluatorImpl.java:293)
    at hu.bme.mit.massif.communication.command.MatlabCommand.execute(MatlabCommand.java:118)
    at hu.bme.mit.massif.simulink.api.Importer.traverseAndCreateEMFModel(Importer.java:503)
    at hu.bme.mit.massif.simulink.importer.ui.handlers.ImportModelHandler$1.run(ImportModelHandler.java:183)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: 
5: Error on invoking command in matlab server 
Additional information:

## {Number of output arguments=1, Type:=eval, Input arguments=, Command:=class(ImporterTmpResult)}

Original exception: 
java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is: 
    java.net.SocketTimeoutException: Read timed out
    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.CommandEvaluatorImpl.dataRetriever(CommandEvaluatorImpl.java:169)
    at hu.bme.mit.massif.communication.commandevaluation.CommandEvaluatorImpl.evaluateCommand(CommandEvaluatorImpl.java:84)
    ... 5 more

and after that, every time I import the model, no further exception appear. Yesterday I just overlooked the first exception.

Thanks again for your help!

Yve

@imbur imbur added the bug label Jul 10, 2018
@imbur imbur self-assigned this Jul 10, 2018
@abelhegedus abelhegedus added this to the 0.8.0 milestone Nov 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants