Getting the latest MATLAB scripting nodes

#1

I'm on KNIME 3.3.1 on Windows 7 and MATLAB scripting is not currently working for me, as mentioned here.

On the page https://tech.knime.org/community/scripting the latest news item says

After a troublesome period with the Matlab integration, a functional version can be currently pulled from the nighly build server (http://update.knime.org/community-contributions/trunk)

However if I click on that link I get a 403 'Forbidden' error.

How can I get my hands on a working version of KNIME's MATLAB integration please? Will it be included in a KNIME workbench update sometime soon?

0 Likes

#2

Thanks to an email from Antje Janosch, I've found the procedure to install the latest build:

  • Uninstall the current version of the extension (Help > Installation Details, select the extension, Uninstall)
  • Help > Install New Software
  • click Add, name e.g. 'trunk build', URL http://update.knime.org/community-contributions/trunk, OK
  • find, select and install the scripting extension

Unfortunately that hasn't got MATLAB scripting working for me yet: now when I run the script node, MATLAB starts up then gives the error:

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:209)
            at java.util.concurrent.Executors$RunnableAdapter.call(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.ServerException: RemoteException occurred in server thread; nested exception is: 
            java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
            java.lang.ClassNotFoundException: matlabcontrol.MatlabSession (no security manager: RMI class loader disabled)
            at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:420)
            at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:268)
            at sun.rmi.transport.Transport$1.run(Transport.java:200)
            at sun.rmi.transport.Transport$1.run(Transport.java:197)
            at java.security.AccessController.doPrivileged(Native Method)
            at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
            at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$256(TCPTransport.java:683)
            at java.security.AccessController.doPrivileged(Native Method)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
            at java.lang.Thread.run(Thread.java:745)
            at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
            at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
            at sun.rmi.server.UnicastRef.invoke(Unknown Source)
            at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
            at matlabcontrol.MatlabBroadcaster.bindSession(MatlabBroadcaster.java:140)
            ... 7 more
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
            java.lang.ClassNotFoundException: matlabcontrol.MatlabSession (no security manager: RMI class loader disabled)
            at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
            at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:410)
            at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:268)
            at sun.rmi.transport.Transport$1.run(Transport.java:200)
            at sun.rmi.transport.Transport$1.run(Transport.java:197)
            at java.security.AccessController.doPrivileged(Native Method)
            at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
            at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$256(TCPTransport.java:683)
            at java.security.AccessController.doPrivileged(Native Method)
            at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
            at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: matlabcontrol.MatlabSession (no security manager: RMI class loader disabled)
            at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:556)
            at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:646)
            at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:311)
            at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStream.java:255)
            at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1559)
            at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1515)
            at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1774)
            at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)
            at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)
            ... 15 more
Connection to Java application could not be established
java.rmi.UnmarshalException: error unmarshalling return; nested exception is: 
            java.io.InvalidClassException: matlabcontrol.LocalHostRMIHelper$LocalHostRMISocketFactory; local class incompatible: stream classdesc serialVersionUID = 2973279795727940224, local class serialVersionUID = 3314625478471143829
            at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
            at matlabcontrol.MatlabConnector$EstablishConnectionRunnable.run(MatlabConnector.java:230)
            at java.util.concurrent.Executors$RunnableAdapter.call(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.io.InvalidClassException: matlabcontrol.LocalHostRMIHelper$LocalHostRMISocketFactory; local class incompatible: stream classdesc serialVersionUID = 2973279795727940224, local class serialVersionUID = 3314625478471143829
            at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
            at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
            at java.io.ObjectInputStream.readClassDesc(Unknown Source)
            at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
            at java.io.ObjectInputStream.readObject0(Unknown Source)
            at java.io.ObjectInputStream.readObject(Unknown Source)
            at sun.rmi.transport.tcp.TCPEndpoint.read(Unknown Source)
            at sun.rmi.transport.LiveRef.read(Unknown Source)
            at sun.rmi.server.UnicastRef2.readExternal(Unknown Source)
            at java.rmi.server.RemoteObject.readObject(Unknown Source)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)
            at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
            at java.io.ObjectInputStream.readSerialData(Unknown Source)
            at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
            at java.io.ObjectInputStream.readObject0(Unknown Source)
            at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
            at java.io.ObjectInputStream.readSerialData(Unknown Source)
            at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
            at java.io.ObjectInputStream.readObject0(Unknown Source)
            at java.io.ObjectInputStream.readObject(Unknown Source)
            ... 7 more

Meanwhile the Matlab Snippet node stays in the 'Executing' state until I cancel it. This still happens with a new Matlab Snippet (or Open in Matlab) node in a new workflow. I'm using KNIME 3.3.2 and MATLAB R2016b on Windows 7 SP1 Enterprise, all 64-bit.

Any ideas please?

0 Likes

#3

This is still not working after the 3.6.0 update…

0 Likes

#4

OK, with 3.7.1 and MATLAB R2018b it finally seems to be working!

The MATLAB console spits out:

Started from KNIME (MATLAB scripting integration)
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:111)
	at matlabcontrol.MatlabBroadcaster.broadcast(MatlabBroadcaster.java:71)
	at matlabcontrol.MatlabConnector$EstablishConnectionRunnable.run(MatlabConnector.java:170)
	at java.util.concurrent.Executors$RunnableAdapter.call(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.ServerException: RemoteException occurred in server thread; nested exception is: 
	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
	java.lang.ClassNotFoundException: matlabcontrol.MatlabSession (no security manager: RMI class loader disabled)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:389)
	at sun.rmi.transport.Transport$1.run(Transport.java:200)
	at sun.rmi.transport.Transport$1.run(Transport.java:197)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
	at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
	at sun.rmi.server.UnicastRef.invoke(Unknown Source)
	at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
	at matlabcontrol.MatlabBroadcaster.bindSession(MatlabBroadcaster.java:109)
	... 7 more
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
	java.lang.ClassNotFoundException: matlabcontrol.MatlabSession (no security manager: RMI class loader disabled)
	at sun.rmi.registry.RegistryImpl_Skel.dispatch(RegistryImpl_Skel.java:78)
	at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:468)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:300)
	at sun.rmi.transport.Transport$1.run(Transport.java:200)
	at sun.rmi.transport.Transport$1.run(Transport.java:197)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: matlabcontrol.MatlabSession (no security manager: RMI class loader disabled)
	at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:556)
	at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:646)
	at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:311)
	at sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStream.java:265)
	at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1795)
	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1743)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2037)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1568)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:428)
	at sun.rmi.registry.RegistryImpl_Skel.dispatch(RegistryImpl_Skel.java:76)
	... 14 more
KNIME: exectuted snippet and updated mOut, kIn and columnMapping.

but as the last line suggests, it does successfully execute (exectute?) the code from the scripting node and return the data to KNIME.

Now what would be nice is (a) if the MATLAB instance could run silently in the background rather than opening up in front of KNIME, and (b) if the data could be exchanged as a base MATLAB table rather than a (deprecated) Statistics Toolbox ‘dataset’ type…

0 Likes

#5

Hi @Tom_Hawkins

I created a feature request on github:

the inbuilt types were kept because of the additional toolbox licenses that might not always be at hand. You can choose the table type in the Preferences > KNIME > Matlab scripting

2 Likes

#6

Thanks! I’d be happy to test any new version of the nodes with a headless option. For me, starting MATLAB minimised would be fine.

Thanks also for pointing me at the data type setting, I’m not sure why I didn’t realise that was there…

1 Like