linkstatic12 / matlabcontrol

Automatically exported from code.google.com/p/matlabcontrol
0 stars 0 forks source link

Problem with LoggingMatlabProxy and feval fprintf #15

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What version of matlabcontrol are you using?
(Release versions: 4.1.0, 4.0.0, 3.1.0, 3.0.1, 3.0.0, or 2.0.0)
4.1.0

What version of MATLAB are you using?
R2013a (8.1.0.604)

What operating system are you using?
Linux - CentOS 5.9

Are you using matlabcontrol from inside MATLAB or outside MATLAB?
Outside

What steps will reproduce the problem?
1. Edit DemoFrame.java to wrap the proxy with a LoggingMatlabProxy
         _proxyHolder.set(new LoggingMatlabProxy(proxy));

2. Run the demo, connect to matlab, select feval
3. Enter fprintf for function
4  For argument, select string and enter blah\n

What did you expect to happen? What happened instead?

Expected "blah" to be printed to matlab console, as it is when the 
LoggingMatlabProxy is not used.

Instead, it throws the following exception and displays an error in the matlab 
console.

If there was a stack trace, please copy it here.

$ java -cp build/classes:../../matlabcontrol-4.1.0.jar 
-Djava.util.logging.config.file=logging.properties demo.gui.RemoteMain
Jul 9, 2013 9:51:24 AM matlabcontrol.LoggingMatlabProxy feval(String, Object...)
FINER: ENTRY fprintf [Ljava.lang.Object;@4aee260b
Jul 9, 2013 9:51:24 AM matlabcontrol.LoggingMatlabProxy feval(String, Object...)
FINER: THROW
matlabcontrol.MatlabInvocationException: Method did not return properly because 
of an internal MATLAB exception
        at matlabcontrol.MatlabInvocationException$Reason.asException(MatlabInvocationException.java:62)
        at matlabcontrol.JMIWrapper$MatlabThreadOperations.returningFeval(JMIWrapper.java:459)
        at matlabcontrol.JMIWrapper$MatlabThreadOperations.feval(JMIWrapper.java:406)
        at matlabcontrol.JMIWrapper$6.call(JMIWrapper.java:180)
        at matlabcontrol.JMIWrapper$6.call(JMIWrapper.java:176)
        at matlabcontrol.JMIWrapper$9.run(JMIWrapper.java:307)
        at com.mathworks.jmi.NativeMatlab.dispatchMTRequests(NativeMatlab.java:364)
        at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
        at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
        at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:178)
        at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:132)
        at matlabcontrol.$Proxy1.feval(Unknown Source)
        at matlabcontrol.RemoteMatlabProxy$6.invoke(RemoteMatlabProxy.java:285)
        at matlabcontrol.RemoteMatlabProxy$6.invoke(RemoteMatlabProxy.java:281)
        at matlabcontrol.RemoteMatlabProxy.invoke(RemoteMatlabProxy.java:182)
        at matlabcontrol.RemoteMatlabProxy.feval(RemoteMatlabProxy.java:280)
        at matlabcontrol.LoggingMatlabProxy$3.invoke(LoggingMatlabProxy.java:248)
        at matlabcontrol.LoggingMatlabProxy.invoke(LoggingMatlabProxy.java:156)
        at matlabcontrol.LoggingMatlabProxy.feval(LoggingMatlabProxy.java:243)
        at demo.gui.DemoFrame$4.actionPerformed(DemoFrame.java:419)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
        at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
        at java.awt.Component.processMouseEvent(Component.java:6290)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
        at java.awt.Component.processEvent(Component.java:6055)
        at java.awt.Container.processEvent(Container.java:2039)
        at java.awt.Component.dispatchEventImpl(Component.java:4653)
        at java.awt.Container.dispatchEventImpl(Container.java:2097)
        at java.awt.Component.dispatchEvent(Component.java:4481)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4575)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4236)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4166)
        at java.awt.Container.dispatchEventImpl(Container.java:2083)
        at java.awt.Window.dispatchEventImpl(Window.java:2482)
        at java.awt.Component.dispatchEvent(Component.java:4481)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:648)
        at java.awt.EventQueue.access$000(EventQueue.java:84)
        at java.awt.EventQueue$1.run(EventQueue.java:607)
        at java.awt.EventQueue$1.run(EventQueue.java:605)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
        at java.awt.EventQueue$2.run(EventQueue.java:621)
        at java.awt.EventQueue$2.run(EventQueue.java:619)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:618)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: com.mathworks.jmi.MatlabException: Function is not defined for 
'cell' inputs.
        at com.mathworks.jmi.NativeMatlab.SendMatlabMessage(Native Method)
        at com.mathworks.jmi.NativeMatlab.sendMatlabMessage(NativeMatlab.java:219)
        at com.mathworks.jmi.MatlabLooper.sendMatlabMessage(MatlabLooper.java:120)
        at com.mathworks.jmi.Matlab.mtFevalConsoleOutput(Matlab.java:1608)
        at matlabcontrol.JMIWrapper$MatlabThreadOperations.returningFeval(JMIWrapper.java:420)
        at matlabcontrol.JMIWrapper$MatlabThreadOperations.feval(JMIWrapper.java:406)
        at matlabcontrol.JMIWrapper$6.call(JMIWrapper.java:180)
        at matlabcontrol.JMIWrapper$6.call(JMIWrapper.java:176)
        at matlabcontrol.JMIWrapper$9.run(JMIWrapper.java:307)
        at com.mathworks.jmi.NativeMatlab.dispatchMTRequests(NativeMatlab.java:364)
Jul 9, 2013 9:51:24 AM matlabcontrol.LoggingMatlabProxy feval(String, Object...)
FINER: RETURN

Please provide any additional information below.
This is printed in the matlab console:
  Error using fprintf
  Function is not defined for 'cell' inputs.

Original issue reported on code.google.com by cart...@gmail.com on 9 Jul 2013 at 4:02

Attachments: