We're Hiring!

Omero-related crash in compiled version of app

General and open developer discussion about using OMERO APIs from C++, Java, Python, Matlab and more! Please new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

If you are having trouble with custom code, please provide a link to a public repository, ideally GitHub.

Omero-related crash in compiled version of app

Postby yuriy_alexandrov » Fri Sep 26, 2014 3:02 pm

..
Hi All,

I'm trying to use "deploytool" in MATLAB (Version: 8.2.0.701 R2013b) to make a PCWIN_64 package of Omero-dependent application.
It uses

- OMEROMatlab 5.0.3, +
- bioformats rev. 4a28d34 build 13 Aug 2014
- bfmatlab - from the same build

I found that, in the compiled version, the line

Code: Select all
image = containerService.getImages('Image',toJavaList(uint64(imageId)),[]).get(0);

causes Java exception

Java exception occurred:
Ice.UnmarshalOutOfBoundsException
reason = (null)
at IceInternal.BasicStream.readString(BasicStream.java:1824)
at IceInternal.BasicStream$EncapsDecoder.readTypeId(BasicStream.java:2838)
at IceInternal.BasicStream$EncapsDecoder10.startSlice(BasicStream.java:3188)
at IceInternal.BasicStream.startReadSlice(BasicStream.java:562)
at omero.model.IObject.__readImpl(IObject.java:519)
at omero.model.Image.__readImpl(Image.java:2403)
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._IContainerDelM.getImages(_IContainerDelM.java:395)
at omero.api.IContainerPrxHelper.getImages(IContainerPrxHelper.java:1209)
at omero.api.IContainerPrxHelper.getImages(IContainerPrxHelper.java:1181)

Obviously, there is lot of Omero code passing normally, except this "getImages" line.
The same line doesn't cause any problems in non-compiled version (when run from Matlab environment).

Thanks,
Y.
yuriy_alexandrov
 
Posts: 126
Joined: Thu Oct 25, 2012 2:06 pm

Re: Omero-related crash in compiled version of app

Postby jmoore » Fri Sep 26, 2014 3:15 pm

Hi Yuriy,

that's an exception caused by the server and client versions being out of sync. What server version are you using?

Cheers,
~Josh.
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany

Re: Omero-related crash in compiled version of app

Postby yuriy_alexandrov » Fri Sep 26, 2014 4:01 pm

Thanks Josh

Server is earlier version's.
Ian suggested looking in omero.web and it says 5.0.2.

I tried "octopus.openmicroscopy.org" instead - it comes up with the same crash.
Again - only for compiled version, when run from Matlab environment, everything works normally.

Albeit octopus might be > 5.0.3 that I use.
If not difficult - could I maybe get the version of the build that is definitely in sync with octopus?

Best,
Y.
yuriy_alexandrov
 
Posts: 126
Joined: Thu Oct 25, 2012 2:06 pm

Re: Omero-related crash in compiled version of app

Postby sbesson » Fri Sep 26, 2014 6:34 pm

Hi Yuriy,

assuming you want to test against the default port of `octopus.openmicroscopy.org` (4064), I would directly download the last release artifacts:

- OMERO.matlab 5.0.5 (http://downloads.openmicroscopy.org/ome ... 5/#plugins)
- Bio-Formats Matlab toolbox 5.0.5 (http://downloads.openmicroscopy.org/bio ... 0.5/#tools)

Best,
Sebastien
User avatar
sbesson
Team Member
 
Posts: 421
Joined: Tue Feb 28, 2012 7:20 pm

Re: Omero-related crash in compiled version of app

Postby yuriy_alexandrov » Fri Sep 26, 2014 10:06 pm

Thanks Sebastien,

An update - after getting recent software components from the advised places, - still behaviour is the same.

Another thing I noticed - when running the app (ic_impoter) under Matlab, I always have warnings.
Could that be a reason? My Matlab window looks like this:

>> ic_importer
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/matlab/R2013b/java/jarext/jxbrowser/slf4j-log4j12.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/yalexand/Imperial-FLIMfit/FLIMfitFrontEnd/BFMatlab/bioformats_package.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

--------------------------
OMERO.matlab Toolbox
5.0.5-ice35-b47
--------------------------
log4j:WARN No appenders could be found for logger (loci.common.services.ServiceFactory).
log4j:WARN Please initialize the log4j system properly.

Closing OMERO session
>>

As one can see, the warnings are related to the presence of "bioformats_package.jar" in the static Java path.
Unfortunately I can't remove it from there since it breaks the app (UI buttons become unresponsive).
The second pair of warnings (log4j) appears immediately after starting the data upload job. I remind, the upload passes normally under Matlab but crushes in the compiled version.

We presently don't use "ic_importer" as we switched to OME.tiffs instead, - but from general viewpoint, it would be nice to know how to use "deploytool" for the code involving OMEROMalab, bioformats and bfmatlab ("deploytool" generates the self-installing packages, and this is really convenient).

Best,
Y.
yuriy_alexandrov
 
Posts: 126
Joined: Thu Oct 25, 2012 2:06 pm

Re: Omero-related crash in compiled version of app

Postby sbesson » Wed Oct 01, 2014 4:15 pm

Hi Yuriy,

regarding your first error, does the getImages method still fail when using the 5.0.5 clients (OMERO.matlab) versus a 5.0.5 OMERO.server?

Regarding your last post, the

Code: Select all
log4j:WARN No appenders could be found for logger (loci.common.services.ServiceFactory).
log4j:WARN Please initialize the log4j system properly.


means that the logging is not initialized. Do you call enableLogging as in https://github.com/openmicroscopy/biofo ... pen.m#L111 in your code?

Sebastien
User avatar
sbesson
Team Member
 
Posts: 421
Joined: Tue Feb 28, 2012 7:20 pm

Re: Omero-related crash in compiled version of app

Postby yuriy_alexandrov » Thu Oct 02, 2014 9:58 am

...
Thanks Sebastien,

regarding your first error, does the getImages method still fail when using the 5.0.5 clients (OMERO.matlab) versus a 5.0.5 OMERO.server?

..yes exactly.

Do you call enableLogging as in https://github.com/openmicroscopy/biofo ... pen.m#L111 in your code?

I found 2 calls of the type

Code: Select all
loci.common.DebugTools.enableLogging('ERROR');

commented them out, but even then, the warnings appeared again in the process of single FOV uploading.
By debugging, I found that these warnings
log4j:WARN No appenders could be found for logger (loci.common.NIOByteBufferProvider).
log4j:WARN Please initialize the log4j system properly.


were thrown just with the line

Code: Select all
writer.setId(ometiffilename);

despite this time there is different reason for warning.

Best regards,
Y.
yuriy_alexandrov
 
Posts: 126
Joined: Thu Oct 25, 2012 2:06 pm

Re: Omero-related crash in compiled version of app

Postby sbesson » Fri Oct 03, 2014 12:43 pm

Hi,

understood. Are you sure this uncommented line is actually executed in your code? From two fresh Matlab command prompts, I have the following behavior:

Code: Select all
>> bfCheckJavaPath;
>> bfsave(zeros(10,10), '/tmp/test.ome.tiff');
log4j:WARN No appenders could be found for logger (loci.common.NIOByteBufferProvider).
log4j:WARN Please initialize the log4j system properly.
>>


reproducing this warning. And then the following when calling `enableLogging`:

Code: Select all
>> bfCheckJavaPath;
>> loci.common.DebugTools.enableLogging('ERROR');
>> bfsave(zeros(10,10), '/tmp/test2.ome.tiff');
>>


Sebastien
User avatar
sbesson
Team Member
 
Posts: 421
Joined: Tue Feb 28, 2012 7:20 pm

Re: Omero-related crash in compiled version of app

Postby yuriy_alexandrov » Fri Oct 03, 2014 4:00 pm

Thanks Sebastien,

Great - adding this line allowed suppressing the warnings; You're right it wasn't actually included in FOV-uploading proc, only in SPW. Will place it level up.

I will ensure that this initialization is also included in importer, re-check compiled version, and come back.

Best regards,
Y.
yuriy_alexandrov
 
Posts: 126
Joined: Thu Oct 25, 2012 2:06 pm

Re: Omero-related crash in compiled version of app

Postby sbesson » Sun Oct 05, 2014 7:34 am

Glad to hear this solved your problem Yuriy,

let us know when you have more details about this compiled application issue.

Best,
Sebastien
User avatar
sbesson
Team Member
 
Posts: 421
Joined: Tue Feb 28, 2012 7:20 pm


Return to Developer Discussion

Who is online

Users browsing this forum: No registered users and 1 guest