Page 1 of 1

UserId issues from Matlab.

PostPosted: Wed Jul 05, 2017 2:49 pm
by i.munro
Hi All

I wonder if anyone can help me?

I'm attempting to update the Java interface that the (Matlab) FLIMfit app uses to browse OMERO to work with 5.3 servers.

The working version (for 5.2 servers) is at https://github.com/flimfit/omeUiUtils/tree/master

So far I have simply updated the pom.
https://github.com/flimfit/omeUiUtils/tree/5.3Test2
Testing from the Java test harness in https://github.com/flimfit/omeUiUtils/b ... #L858-L875 everything looks good.

However when I call the same code from Matlab it crashes on the line
Experimenter exp = session.getAdminService().getExperimenter(userId);
https://github.com/flimfit/omeUiUtils/b ... .java#L185

With the errors below:
I have checked that the userId is the correct one & ( just to eliminate type passing oddities) tried hard-coding it to the correct No.

Is it possible that this error is some new group-related behaviour that I've missed?
Many Thanks

Ian

Java exception occurred:
Ice.MarshalException
reason = "invalid object id"
at IceInternal.BasicStream$EncapsDecoder10.readObject(BasicStream.java:3042)
at IceInternal.BasicStream.readObject(BasicStream.java:2048)
at omero.model.IObject.__readImpl(IObject.java:520)
at omero.model.Experimenter.__readImpl(Experimenter.java:1537)
at Ice.ObjectImpl.__read(ObjectImpl.java:365)
at IceInternal.BasicStream$EncapsDecoder.unmarshal(BasicStream.java:2936)
at IceInternal.BasicStream$EncapsDecoder10.readInstance(BasicStream.java:3307)
at IceInternal.BasicStream$EncapsDecoder10.readPendingObjects(BasicStream.java:3235)
at IceInternal.BasicStream.readPendingObjects(BasicStream.java:584)
at omero.api._IAdminDelM.getExperimenter(_IAdminDelM.java:1159)
at omero.api.IAdminPrxHelper.getExperimenter(IAdminPrxHelper.java:5783)
at omero.api.IAdminPrxHelper.getExperimenter(IAdminPrxHelper.java:5746)
at OMEuiUtils.OMEROImageChooser.<init>(OMEROImageChooser.java:186)
at OMEuiUtils.OMEROImageChooser.<init>(OMEROImageChooser.java:130)

Re: UserId issues from Matlab.

PostPosted: Wed Jul 05, 2017 3:11 pm
by i.munro
I should add that the Matlab code to log on to OMERO is at

https://github.com/flimfit/FLIMfit/blob ... m#L84-L125

and the java code is called from e.g. https://github.com/flimfit/FLIMfit/blob ... #L388-L392

Re: UserId issues from Matlab.

PostPosted: Thu Jul 06, 2017 9:04 am
by i.munro
IT occurs to me that if I'm really seeing different behaviour , as I think, then it has to be a Java version mismatch. FYI version -java in Matlab gives me: Java 1.7.0_75-b13
but I seem to be using 1.8 to build omeUiUtils.

Re: UserId issues from Matlab.

PostPosted: Thu Jul 06, 2017 10:42 am
by sbesson
Hi Ian,

the `Ice.MarshalException` you are receiving is similar to the error one would receive if the server and client versions were mismatching. For instance that would be what you get if you try to connect to an OMERO 5.3 server using the OMERO 5.2 command line interface with `bin/omero login`.

As far as I understand, the individual Java component works standalone when built using the OMERO 5.3 dependencies against a OMERO 5.3 server.

I assume the version of OMERO.matlab used is also OMERO 5.3.3. First debugging question would be: does the connection work if you are calling the method directly from the MATLAB as in this minimal example without invoking the OMEROImageChooser utility?

Sebastien

Re: UserId issues from Matlab.

PostPosted: Fri Jul 07, 2017 11:15 am
by i.munro
Hi Sebastien

Thank you for your input. You are entirely correct! I had stupidly managed to start testing with an old version
of the OMERO.Matlab toolbox. Installing the latest version solved my issue.

My apologies for wasting your time with something that I should have spotted myself.

Sincerely

Ian

Re: UserId issues from Matlab.

PostPosted: Sun Jul 09, 2017 2:22 pm
by i.munro
Hi again Sebastien

On a different note, In the minimal example you linked above an unencrypted session is used for faster data transfer.
Can I ask if there are are circumstances where I shouldn't use such a session or can I safely use it for everything once logged on?

Thanks

Ian

Re: UserId issues from Matlab.

PostPosted: Sun Jul 09, 2017 4:20 pm
by jmoore
Hi Ian,

Can I ask if there are are circumstances where I shouldn't use such a session or can I safely use it for everything once logged on?


Any method that we consider truly unsafe for invocation with a non-encrypted session (change of password, etc) will throw an exception if you attempt to do so. A user could conceivably consider other metadata of sufficient value that s/he doesn't want it transmitted without encryption which is why the little lock symbol is made available in insight. (In the web, it's having an HTTPS connection which is of importance.)

Cheers,
~Josh.

Re: UserId issues from Matlab.

PostPosted: Mon Jul 10, 2017 11:19 am
by i.munro
Thanks Josh

Best Wishes

Ian