Matlab 2019b cannot connect to omero

Hello,

I recently updated our omero server to 5.5.1 and aim to connect to it with matlab. It works fine with matlab 2019a but with 2019b it fails with the error below. We use also CUDA accelerated computations and thus would like to move to that new version of matlab. Could the bug be related to the version of java ? It reminds me the issue with ciphering on the server but since everything is compiled, I don’t see how to apply a correction like in https://docs.openmicroscopy.org/omero/5.5.1/sysadmins/troubleshooting.html. If you have suggestions, I am interested !
Thank you for your help in fixing this issue.

=============== test code ================
version
version -java

map=javaObject(‘java.util.HashMap’);
map.put(‘omero.user’,‘jacques’);
map.put(‘omero.pass’,’***************’);
map.put(‘omero.group’,‘CeDRE’);
map.put(‘omero.host’,‘cedre-5a’);
map.put(‘omero.port’,int16(4064));

[secure_client_,secure_session_] = loadOmero_helper(map);

================ 2019a ================
ans =

'9.6.0.1072779 (R2019a)'

ans =

'Java 1.8.0_181-b13 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode'

OMERO.matlab Toolbox
5.5.1

================ 2019b =======================
ans =

'9.7.0.1190202 (R2019b)'

ans =

'Java 1.8.0_202-b08 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode'

OMERO.matlab Toolbox
5.5.1

Error using connectOmero (line 71)
Java exception occurred:
Ice.SecurityException
reason = “IceSSL: handshake error”
at IceInternal.AsyncResultI.__wait(AsyncResultI.java:276)
at Ice.ObjectPrxHelperBase.end_ice_isA(ObjectPrxHelperBase.java:310)
at Ice.ObjectPrxHelperBase.ice_isA(ObjectPrxHelperBase.java:92)
at Ice.ObjectPrxHelperBase.ice_isA(ObjectPrxHelperBase.java:69)
at Ice.ObjectPrxHelperBase.checkedCastImpl(ObjectPrxHelperBase.java:2810)
at Ice.ObjectPrxHelperBase.checkedCastImpl(ObjectPrxHelperBase.java:2770)
at Glacier2.RouterPrxHelper.checkedCast(RouterPrxHelper.java:1787)
at omero.client.getRouter(client.java:888)
at omero.client.createSession(client.java:809)
at omero.client.createSession(client.java:753)
Caused by: javax.net.ssl.SSLException: Received fatal alert: handshake_failure
at sun.security.ssl.Alerts.getSSLException(Alerts.java:208)
at sun.security.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1647)
at sun.security.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1615)
at sun.security.ssl.SSLEngineImpl.recvAlert(SSLEngineImpl.java:1781)
at sun.security.ssl.SSLEngineImpl.readRecord(SSLEngineImpl.java:1070)
at sun.security.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:896)
at sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:766)
at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:624)
at IceSSL.TransceiverI.handshakeNonBlocking(TransceiverI.java:381)
at IceSSL.TransceiverI.initialize(TransceiverI.java:33)
at Ice.ConnectionI.initialize(ConnectionI.java:1921)
at Ice.ConnectionI.message(ConnectionI.java:940)
at IceInternal.ThreadPool.run(ThreadPool.java:395)
at IceInternal.ThreadPool.access$300(ThreadPool.java:12)
at IceInternal.ThreadPool$EventHandlerThread.run(ThreadPool.java:832)
at java.lang.Thread.run(Thread.java:748)

Error in loadOmero (line 103)
[client, session] = connectOmero(varargin{:});

Error in loadOmero_helper (line 5)
[varargout{:}] = loadOmero(varargin{:});

1 Like

Hi Jacques

You should try to start MATLAB with another Java Version than the one bundled.
For example see
https://uk.mathworks.com/matlabcentral/answers/103056-how-do-i-change-the-java-virtual-machine-jvm-that-matlab-is-using-on-macos

Cheers

Jmarie

Dear Jean-Marie,
I tried with openjdk-8 (the one version supported by 5.5.x) but I had no more success. Does it means that an old version of openjdk should be used ?
I would be willing to test this same java version with insight but I don’t know how to check within insight the java version. On linux, insight comes with a java embedded or use the system one ?
Thank you for your help,

Best

Jacques

version
version -java
map=javaObject(‘java.util.HashMap’)
map.put(‘omero.user’,‘jacques’);
map.put(‘omero.pass’,’**************’);
map.put(‘omero.group’,‘CeDRE’);
map.put(‘omero.host’,‘cedre-5a’);
map.put(‘omero.port’,int16(4064));

ans =

'9.7.0.1216025 (R2019b) Update 1'

ans =

'Java 1.8.0_232-b09 with AdoptOpenJDK OpenJDK 64-Bit Server VM mixed mode'

map =

{}

[secure_client_, secure_session_] = loadOmero(map)
Unrecognized function or variable ‘loadOmero’.

addpath OMERO.matlab/
[secure_client_, secure_session_] = loadOmero(map)


OMERO.matlab Toolbox
5.5.1

Error using connectOmero (line 71)
Java exception occurred:
Ice.ConnectionLostException
error = 0
at IceInternal.AsyncResultI.__wait(AsyncResultI.java:276)
at Ice.ObjectPrxHelperBase.end_ice_isA(ObjectPrxHelperBase.java:310)
at Ice.ObjectPrxHelperBase.ice_isA(ObjectPrxHelperBase.java:92)
at Ice.ObjectPrxHelperBase.ice_isA(ObjectPrxHelperBase.java:69)
at Ice.ObjectPrxHelperBase.checkedCastImpl(ObjectPrxHelperBase.java:2810)
at Ice.ObjectPrxHelperBase.checkedCastImpl(ObjectPrxHelperBase.java:2770)
at Glacier2.RouterPrxHelper.checkedCast(RouterPrxHelper.java:1787)
at omero.client.getRouter(client.java:888)
at omero.client.createSession(client.java:809)
at omero.client.createSession(client.java:753)

Error in loadOmero (line 103)
[client, session] = connectOmero(varargin{:});

Dear Jacques

Insight uses the version of Java installed.
It looks like a problem we have noticed in some cases with Fiji
The first time it returns a similar error and the second time it works
insight works everytime.
The error is due to the Java version, but we have not been able to find out yet what triggers it the first time

Could you try to run matlab script twice to see if it is the same issue?

Cheers

Jmarie

Hello Jean-Marie,

It tried multiple times and unfortunately, it does not allow to connect. But curiously, the error the third times (and fourth one as well) is different, with handshake issue, in contrast to the two first ones.

About the Fiji issue you are mentioning, did you exclude some causes (for exemple the parameters of the jvm ? or some version of external dynamically linked library that may differ in Fiji/Matlab versus Insight. I indeed got this problem with another code due to an old libtiff version shipped with Matlab and different from the system one.
Thank you for your suggestions.
Best

Jacques

Hi Jacques
Thanks for the information
In Fiji, it depends on the Jva version bundled with Fiji if that option is chosen.
I have not looked at the Matlab yet.

Best
Jmarie

Hi,

I tried to downgrade my java version and 192-b12 appears to be the last one where things are running smoothly. From 202 and above, the issue happens. Is there any chance that this could be fixed or will I have to anticipate to stick with the java version ?
Thank you for these informations.

Best

Jacques

Hi Jacques

Thanks for digging into this issue.
Our recent effort has been on upgrading our Python stack to Python 3. Now that this is almost behind us we should be able to look at the problem.

Chers

Jmarie