[ome-devel] Strange issue when bioformats_package.jar is used instead of loci_tools.jar

Ponti Aaron aaron.ponti at bsse.ethz.ch
Wed Sep 10 14:02:15 BST 2014


Dear list,

I am using bioformats in the openBIS Importer Toolset (http://www.scs2.net/next/index.php?id=150) to extract metadata information from microscopy files and I am facing an issue that puzzles me. Consider the following code snippet (I only leave what is important):

<code>
    ...

    // Create the reader
    reader = new ImageProcessorReader(
        new ChannelSeparator(
            LociPrefs.makeImageReader()));

    ...

    try {
        factory = new ServiceFactory();
        service = factory.getInstance(OMEXMLService.class);
    } catch (DependencyException e) {
        ...
    }

    try {
        omexmlMeta = service.createOMEXMLMetadata();
    } catch (ServiceException e) {
       ...
    }
    reader.setMetadataStore(omexmlMeta);

    // Try to open the image file
    try {
        reader.setId(filename.getCanonicalPath());
    } catch (FormatException e) {
        ...
    }


</code>

Now, if I add loci_tools.jar (5.0.4) to the build path, everything works without any problem; if I add bioformats_package.jar (5.0.4, both downloaded from http://downloads.openmicroscopy.org/bio-formats/5.0.4/) I get the following when

    reader.setId(filename.getCanonicalPath());

is reached:

<log>

14:22:53.768 [SwingWorker-pool-2-thread-5] INFO  loci.formats.ImageReader - ND2Reader initializing D:\user\pontia\Experiment_2\Captured for 4.nd2
14:22:53.768 [SwingWorker-pool-2-thread-5] DEBUG loci.formats.FormatHandler - ND2Reader initializing D:\user\pontia\Experiment_2\Captured for 4.nd2
14:22:53.768 [SwingWorker-pool-2-thread-5] DEBUG loci.formats.FormatHandler - loci.formats.in.ND2Reader.initFile(D:\user\pontia\Experiment_2\Captured for 4.nd2)
14:22:53.768 [SwingWorker-pool-2-thread-5] DEBUG loci.formats.FormatHandler - NativeND2Reader initializing D:\user\pontia\Experiment_2\Captured for 4.nd2
14:22:53.768 [SwingWorker-pool-2-thread-5] DEBUG loci.formats.FormatHandler - loci.formats.in.NativeND2Reader.initFile(D:\user\pontia\Experiment_2\Captured for 4.nd2)
14:22:53.768 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Searching for blocks
14:22:53.768 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'ND2 FILE SIG' 0%
14:22:53.774 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'ImageCalibra' 0%
14:22:53.782 [SwingWorker-pool-2-thread-5] DEBUG loci.formats.FormatHandler -
java.lang.NegativeArraySizeException: null
    at loci.common.RandomAccessInputStream.readString(RandomAccessInputStream.java:406) ~[bioformats_package.jar:na]
    at loci.formats.in.NativeND2Reader.iterateIn(NativeND2Reader.java:1570) [bioformats_package.jar:na]
    at loci.formats.in.NativeND2Reader.iterateIn(NativeND2Reader.java:1644) [bioformats_package.jar:na]
    at loci.formats.in.NativeND2Reader.iterateIn(NativeND2Reader.java:1644) [bioformats_package.jar:na]
    at loci.formats.in.NativeND2Reader.iterateIn(NativeND2Reader.java:1644) [bioformats_package.jar:na]
    at loci.formats.in.NativeND2Reader.iterateIn(NativeND2Reader.java:1644) [bioformats_package.jar:na]
    at loci.formats.in.NativeND2Reader.iterateIn(NativeND2Reader.java:1644) [bioformats_package.jar:na]
    at loci.formats.in.NativeND2Reader.initFile(NativeND2Reader.java:420) [bioformats_package.jar:na]
    at loci.formats.FormatReader.setId(FormatReader.java:1317) [bioformats_package.jar:na]
    at loci.formats.DelegateReader.setId(DelegateReader.java:253) [bioformats_package.jar:na]
    at loci.formats.ImageReader.setId(ImageReader.java:753) [bioformats_package.jar:na]
    at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:569) [bioformats_package.jar:na]
    at loci.formats.ChannelSeparator.setId(ChannelSeparator.java:270) [bioformats_package.jar:na]
    at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:569) [bioformats_package.jar:na]
    at ch.ethz.scu.obit.microscopy.readers.MicroscopyReader.init(MicroscopyReader.java:106) [bin/:na]
    at ch.ethz.scu.obit.microscopy.readers.MicroscopyReader.<init>(MicroscopyReader.java:66) [bin/:na]
    at ch.ethz.scu.obit.microscopy.processors.data.MicroscopyProcessor$MicroscopyFile.scanForSeries(MicroscopyProcessor.java:524) [bin/:na]
    at ch.ethz.scu.obit.microscopy.gui.viewers.data.MicroscopyViewer$1Worker.doInBackground(MicroscopyViewer.java:371) [bin/:na]
    at ch.ethz.scu.obit.microscopy.gui.viewers.data.MicroscopyViewer$1Worker.doInBackground(MicroscopyViewer.java:1) [bin/:na]
    at javax.swing.SwingWorker$1.call(Unknown Source) [na:1.7.0_51]
    at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.7.0_51]
    at javax.swing.SwingWorker.run(Unknown Source) [na:1.7.0_51]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.7.0_51]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.7.0_51]
    at java.lang.Thread.run(Unknown Source) [na:1.7.0_51]
14:22:53.795 [SwingWorker-pool-2-thread-5] DEBUG loci.formats.FormatHandler -
java.lang.NegativeArraySizeException: null
    at loci.common.RandomAccessInputStream.readString(RandomAccessInputStream.java:406) ~[bioformats_package.jar:na]

...

14:22:53.990 [SwingWorker-pool-2-thread-5] DEBUG loci.formats.FormatHandler -
java.lang.NegativeArraySizeException: null
    at loci.common.RandomAccessInputStream.readString(RandomAccessInputStream.java:406) ~[bioformats_package.jar:na]
    at loci.formats.in.NativeND2Reader.iterateIn(NativeND2Reader.java:1570) [bioformats_package.jar:na]
    at loci.formats.in.NativeND2Reader.iterateIn(NativeND2Reader.java:1644) [bioformats_package.jar:na]
    at loci.formats.in.NativeND2Reader.iterateIn(NativeND2Reader.java:1644) [bioformats_package.jar:na]
    at loci.formats.in.NativeND2Reader.iterateIn(NativeND2Reader.java:1644) [bioformats_package.jar:na]
    at loci.formats.in.NativeND2Reader.iterateIn(NativeND2Reader.java:1644) [bioformats_package.jar:na]
    at loci.formats.in.NativeND2Reader.iterateIn(NativeND2Reader.java:1644) [bioformats_package.jar:na]
    at loci.formats.in.NativeND2Reader.initFile(NativeND2Reader.java:420) [bioformats_package.jar:na]
    at loci.formats.FormatReader.setId(FormatReader.java:1317) [bioformats_package.jar:na]
    at loci.formats.DelegateReader.setId(DelegateReader.java:253) [bioformats_package.jar:na]
    at loci.formats.ImageReader.setId(ImageReader.java:753) [bioformats_package.jar:na]
    at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:569) [bioformats_package.jar:na]
    at loci.formats.ChannelSeparator.setId(ChannelSeparator.java:270) [bioformats_package.jar:na]
    at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:569) [bioformats_package.jar:na]
    at ch.ethz.scu.obit.microscopy.readers.MicroscopyReader.init(MicroscopyReader.java:106) [bin/:na]
    at ch.ethz.scu.obit.microscopy.readers.MicroscopyReader.<init>(MicroscopyReader.java:66) [bin/:na]
    at ch.ethz.scu.obit.microscopy.processors.data.MicroscopyProcessor$MicroscopyFile.scanForSeries(MicroscopyProcessor.java:524) [bin/:na]
    at ch.ethz.scu.obit.microscopy.gui.viewers.data.MicroscopyViewer$1Worker.doInBackground(MicroscopyViewer.java:371) [bin/:na]
    at ch.ethz.scu.obit.microscopy.gui.viewers.data.MicroscopyViewer$1Worker.doInBackground(MicroscopyViewer.java:1) [bin/:na]
    at javax.swing.SwingWorker$1.call(Unknown Source) [na:1.7.0_51]
    at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.7.0_51]
    at javax.swing.SwingWorker.run(Unknown Source) [na:1.7.0_51]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.7.0_51]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.7.0_51]
    at java.lang.Thread.run(Unknown Source) [na:1.7.0_51]
14:22:54.005 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'ImageMetadat' 0%
14:22:54.008 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'ImageDataSeq' 2%
14:22:54.008 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'ImageTextInf' 94%
14:22:54.009 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'CustomDataVa' 95%
14:22:54.009 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'CustomData|C' 95%
14:22:54.009 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'CustomData|C' 95%
14:22:54.009 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'CustomData|C' 95%
14:22:54.009 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'CustomData|C' 96%
14:22:54.009 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'CustomData|C' 96%
14:22:54.010 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'CustomData|C' 96%
14:22:54.010 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'CustomData|C' 96%
14:22:54.010 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'CustomData|C' 96%
14:22:54.010 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'CustomData|C' 96%
14:22:54.010 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'CustomData|P' 96%
14:22:54.010 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'CustomData|P' 97%
14:22:54.010 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'CustomData|X' 97%
14:22:54.010 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'CustomData|Y' 97%
14:22:54.010 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'CustomData|Z' 97%
14:22:54.010 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'CustomData|Z' 97%
14:22:54.010 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'CustomData|Z' 97%
14:22:54.011 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'CustomDataVa' 97%
14:22:54.011 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'CustomDataVa' 98%
14:22:54.011 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'CustomDataVa' 98%
14:22:54.012 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'CustomDataVa' 98%
14:22:54.012 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'CustomDataVa' 98%
14:22:54.013 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'CustomData|A' 99%
14:22:54.013 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'CustomData|A' 99%
14:22:54.013 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'CustomData|A' 99%
14:22:54.013 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'ImageAttribu' 99%
14:22:54.013 [SwingWorker-pool-2-thread-5] INFO  loci.formats.FormatHandler - Parsing block 'ND2 FILEMAP ' 99%
14:22:54.015 [SwingWorker-pool-2-thread-5] DEBUG loci.formats.FormatHandler - Could not parse XML
java.io.IOException: null
    at loci.common.xml.XMLTools.parseXML(XMLTools.java:436) ~[bioformats_package.jar:na]
    at loci.common.xml.XMLTools.parseXML(XMLTools.java:414) ~[bioformats_package.jar:na]
    at loci.common.xml.XMLTools.parseXML(XMLTools.java:393) ~[bioformats_package.jar:na]
    at loci.formats.in.NativeND2Reader.parseText(NativeND2Reader.java:2054) [bioformats_package.jar:na]
    at loci.formats.in.NativeND2Reader.initFile(NativeND2Reader.java:726) [bioformats_package.jar:na]
    at loci.formats.FormatReader.setId(FormatReader.java:1317) [bioformats_package.jar:na]
    at loci.formats.DelegateReader.setId(DelegateReader.java:253) [bioformats_package.jar:na]
    at loci.formats.ImageReader.setId(ImageReader.java:753) [bioformats_package.jar:na]
    at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:569) [bioformats_package.jar:na]
    at loci.formats.ChannelSeparator.setId(ChannelSeparator.java:270) [bioformats_package.jar:na]
    at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:569) [bioformats_package.jar:na]
    at ch.ethz.scu.obit.microscopy.readers.MicroscopyReader.init(MicroscopyReader.java:106) [bin/:na]
    at ch.ethz.scu.obit.microscopy.readers.MicroscopyReader.<init>(MicroscopyReader.java:66) [bin/:na]
    at ch.ethz.scu.obit.microscopy.processors.data.MicroscopyProcessor$MicroscopyFile.scanForSeries(MicroscopyProcessor.java:524) [bin/:na]
    at ch.ethz.scu.obit.microscopy.gui.viewers.data.MicroscopyViewer$1Worker.doInBackground(MicroscopyViewer.java:371) [bin/:na]
    at ch.ethz.scu.obit.microscopy.gui.viewers.data.MicroscopyViewer$1Worker.doInBackground(MicroscopyViewer.java:1) [bin/:na]
    at javax.swing.SwingWorker$1.call(Unknown Source) [na:1.7.0_51]
    at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.7.0_51]
    at javax.swing.SwingWorker.run(Unknown Source) [na:1.7.0_51]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.7.0_51]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.7.0_51]
    at java.lang.Thread.run(Unknown Source) [na:1.7.0_51]
Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) ~[na:1.7.0_51]
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(Unknown Source) ~[na:1.7.0_51]
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source) ~[na:1.7.0_51]
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source) ~[na:1.7.0_51]
    at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(Unknown Source) ~[na:1.7.0_51]
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source) ~[na:1.7.0_51]
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source) ~[na:1.7.0_51]
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) ~[na:1.7.0_51]
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) ~[na:1.7.0_51]
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) ~[na:1.7.0_51]
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source) ~[na:1.7.0_51]
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source) ~[na:1.7.0_51]
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) ~[na:1.7.0_51]
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(Unknown Source) ~[na:1.7.0_51]
    at javax.xml.parsers.SAXParser.parse(Unknown Source) ~[na:1.7.0_51]
    at loci.common.xml.XMLTools.parseXML(XMLTools.java:428) ~[bioformats_package.jar:na]
    ... 21 common frames omitted
14:22:54.029 [SwingWorker-pool-2-thread-5] DEBUG loci.formats.FormatTools - Expected positive value for PhysicalSizeZ; got 0.0
14:22:54.029 [SwingWorker-pool-2-thread-5] DEBUG loci.formats.FormatTools - Expected positive value for EmissionWavelength; got 0
14:22:54.037 [SwingWorker-pool-2-thread-5] DEBUG loci.common.Location - Location.mapFile: embedded-stream.raw -> null

</log>

There is absolutely no issue (logged at least) when loci_tools.jar is used. Interestingly, the metadata seems to be read even when bioformats_package.jar is used, despite all exceptions. The problem is that openBIS monitors the execution of dropboxes and if it catches exceptions it stops the registration of data. This is the case when bioformats_package.jar is used, and is not when loci_tools.jar is used.

I attached the full log and the ND2 file from the example (other ND2 files behave the same; LSM files, for instance, don't). Can anyone give me a hint what might be happening here? Nothing seems to be missing from the bioformats_package.jar that would be in loci_tools.jar.

Thanks a lot,
a2

----
Dr. Aaron Ponti
Software and Data Management Engineer
Single Cell Unit
Department of Biosystems Science and Engineering (D-BSSE)
ETH Zürich
Office 2.24
Mattenstrasse 26
4058 Basel, Switzerland
aaron.ponti at bsse.ethz.ch
+41 61 387 33 74

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20140910/ffe7c513/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Captured for 4.zip
Type: application/x-zip-compressed
Size: 1740893 bytes
Desc: Captured for 4.zip
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20140910/ffe7c513/attachment-0001.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: complete_log.txt
URL: <http://lists.openmicroscopy.org.uk/pipermail/ome-devel/attachments/20140910/ffe7c513/attachment-0001.txt>


More information about the ome-devel mailing list