We're Hiring!

ICE.UnmarshalOutOfBoundsException ImageJ plugin

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.

ICE.UnmarshalOutOfBoundsException ImageJ plugin

Postby a.herbert » Wed Aug 10, 2011 1:26 pm

Hi,

I am using the OMERO ImageJ plugin to download images from OMERO. I can run the plugin and connect to OMERO. I can then expand my project entries to view the datasets. When I expand a dataset I get an IJ message "An error occurred while loading data." and the plugin closes. There is no further information (client v4.3.0).

I had a look at the source code and saw that the exception stack trace is sent to the ImageJ log in version 4.3.1 but not in 4.3.0 (the version we are using in production). I recompiled 4.3.0 with the exception logging and traced the error to an ICE.UnmarshalOutOfBoundsException:

Code: Select all
ome.ij.data.DSAccessException: Cannot access data.
Cannot load hierarchy for class pojos.DatasetData.
   at ome.ij.data.Gateway.handleException(Gateway.java:190)
   at ome.ij.data.Gateway.loadContainerHierarchy(Gateway.java:594)
   at ome.ij.data.DataServiceImpl.loadImages(DataServiceImpl.java:85)
   at ome.ij.dm.browser.BrowserComponent.loadExperimenterData(BrowserComponent.java:257)
   at ome.ij.dm.browser.BrowserControl.onNodeNavigation(BrowserControl.java:191)
   at ome.ij.dm.browser.BrowserUI.onNodeNavigation(BrowserUI.java:222)
   at ome.ij.dm.browser.BrowserUI.access$400(BrowserUI.java:85)
   at ome.ij.dm.browser.BrowserUI$5.treeExpanded(BrowserUI.java:499)
   at javax.swing.JTree.fireTreeExpanded(JTree.java:2666)
   at javax.swing.JTree.setExpandedState(JTree.java:3427)
   at javax.swing.JTree.expandPath(JTree.java:2163)
   at javax.swing.plaf.basic.BasicTreeUI.toggleExpandState(BasicTreeUI.java:2204)
   at javax.swing.plaf.basic.BasicTreeUI.handleExpandControlClick(BasicTreeUI.java:2191)
   at javax.swing.plaf.basic.BasicTreeUI.checkForClickInExpandControl(BasicTreeUI.java:2149)
   at javax.swing.plaf.basic.BasicTreeUI$Handler.handleSelection(BasicTreeUI.java:3511)
   at javax.swing.plaf.basic.BasicTreeUI$Handler.mousePressed(BasicTreeUI.java:3459)
   at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:262)
   at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:262)
   at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:262)
   at java.awt.Component.processMouseEvent(Component.java:6260)
   at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
   at java.awt.Component.processEvent(Component.java:6028)
   at java.awt.Container.processEvent(Container.java:2041)
   at java.awt.Component.dispatchEventImpl(Component.java:4630)
   at java.awt.Container.dispatchEventImpl(Container.java:2099)
   at java.awt.Component.dispatchEvent(Component.java:4460)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
   at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4235)
   at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
   at java.awt.Container.dispatchEventImpl(Container.java:2085)
   at java.awt.Window.dispatchEventImpl(Window.java:2478)
   at java.awt.Component.dispatchEvent(Component.java:4460)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: Ice.UnmarshalOutOfBoundsException
    reason = (null)
   at IceInternal.BasicStream.readString(BasicStream.java:1347)
   at IceInternal.BasicStream.readTypeId(BasicStream.java:665)
   at omero.model.IObject.__read(IObject.java:462)
   at omero.model.PixelsType.__read(PixelsType.java:296)
   at IceInternal.BasicStream.readObject(BasicStream.java:1590)
   at IceInternal.BasicStream.readPendingObjects(BasicStream.java:1739)
   at omero.api._IContainerDelM.loadContainerHierarchy(_IContainerDelM.java:607)
   at omero.api.IContainerPrxHelper.loadContainerHierarchy(IContainerPrxHelper.java:730)
   at omero.api.IContainerPrxHelper.loadContainerHierarchy(IContainerPrxHelper.java:702)
   at ome.ij.data.Gateway.loadContainerHierarchy(Gateway.java:591)
   ... 37 more


I had a search for this on Google and the top hit was actually from this forum:

http://www.openmicroscopy.org/community/viewtopic.php?f=6&t=37

The thread suggested that it could be a difference between the platforms (32-bit/64-bit) where the code has been compiled. I copied the rest of the jars from the Omero_ImageJ build output on to my problem machine and the error disappeared. This is a vanilla checkout of 4.3.0 built on Linux 64-bit. It seems that this works for my target machines (also 64-bit Linux) but the official release downloaded from OME does not.

http://www.openmicroscopy.org/site/support/omero4/downloads

So I have fixed my problem but I thought I would post this to see if any of the developers were interested. I can run some different checkout builds if you think that will provide some more useful information.

Regards,

Alex
a.herbert
 
Posts: 53
Joined: Tue Jan 11, 2011 1:35 pm

Re: ICE.UnmarshalOutOfBoundsException ImageJ plugin

Postby jmoore » Wed Aug 10, 2011 2:10 pm

Hi Alex,

no 32/64 issues should not appear in a Java/Java system. My guess would more be that there's a classpath issue with the various jars. Could you reproduce the failure with the "-verbose:class" command-line option, and then copy the jars and successfully run, again with "-verbose:class" set?

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

Re: ICE.UnmarshalOutOfBoundsException ImageJ plugin

Postby a.herbert » Thu Aug 11, 2011 9:40 am

Hi Josh,

A classpath issue sounds more likely.

For the tests I have downloaded the latest BioFormats loci_tools.jar into the plugins folder of ImageJ. I have run the following tests all with v4.3.0:

1. OMERO ImageJ plugin:

java -verbose:class -Xmx512m -jar ij.jar > /tmp/OMERO.ImageJ.verbose.out

- Run Plugins > OMERO > Import from OMERO
- Login
- Open the top-level project
- Open the top-level dataset => ERROR
- Close ImageJ

2. OMERO ImageJ plugin recompiled on my machine:

java -verbose:class -Xmx512m -jar ij.jar > /tmp/OMERO.ImageJ.recompiled.verbose.out

- Run Plugins > OMERO > Import from OMERO
- Login
- Open the top-level project
- Open the top-level dataset => OK
- Close ImageJ

3. OMERO ImageJ plugin recompiled on my machine:

java -verbose:class -Xmx512m -jar ij.jar > /tmp/OMERO.ImageJ.recompiled.verbose2.out

- Run Plugins > OMERO > Import from OMERO
- Login
- Open the top-level project
- Open the top-level dataset => OK
- View the image => OK
- Successfully import image through BioFormats plugin
- Close ImageJ

Let me know if you need some further tests and output.

Regards,

Alex
Attachments
OMERO.ImageJ.verbose.tgz
(88.51 KiB) Downloaded 182 times
a.herbert
 
Posts: 53
Joined: Tue Jan 11, 2011 1:35 pm

Re: ICE.UnmarshalOutOfBoundsException ImageJ plugin

Postby a.herbert » Thu Aug 11, 2011 10:13 am

Hi Josh,

I had a quick look for differences between the verbose outputs. It seems that the OMERO ImageJ plugin has an ome-tools.jar. This is being used to load the OMERO classes. In my compiled version I do not have this jar. The same classes are coming from omero-client.jar.

To put together my plugin I simply ran ant from the OME source tree:

Code: Select all
ome/components/tools/OmeroImageJ/Omero_ImageJ


This generated:

Code: Select all
[ah403@tallinn /home/scratch/ome/components/tools/OmeroImageJ/Omero_ImageJ] % ls -l target/*.jar
-rw-r--r-- 1 ah403 ah403 72106 2011-08-10 13:55 target/Omero_ImageJ.jar

[ah403@tallinn /home/scratch/ome/components/tools/OmeroImageJ/Omero_ImageJ] % ls -l target/libs
total 20
lrwxrwxrwx 1 ah403 ah403 97 2011-08-10 12:27 commons-logging.jar -> /home/scratch/ome/etc/../lib/cache/commons-logging/commons-logging/jars/commons-logging-1.1.1.jar
lrwxrwxrwx 1 ah403 ah403 57 2011-08-10 12:27 ij.jar -> /home/scratch/ome/etc/../lib/cache/ij/ij/jars/ij-1.41.jar
lrwxrwxrwx 1 ah403 ah403 81 2011-08-10 12:27 omero_client.jar -> /home/scratch/ome/etc/../lib/cache/omero/omero_client/jars/omero_client-4.3.0.jar
lrwxrwxrwx 1 ah403 ah403 97 2011-08-10 12:27 omero-clients-util.jar -> /home/scratch/ome/etc/../lib/cache/gui/omero-clients-util/jars/omero-clients-util-r7223-b1483.jar
lrwxrwxrwx 1 ah403 ah403 67 2011-08-10 12:27 swingx.jar -> /home/scratch/ome/etc/../lib/cache/gui/swingx/jars/swingx-0.9.4.jar       
lrwxrwxrwx 1 ah403 ah403 93 2011-08-10 12:27 TableLayout.jar -> /home/scratch/ome/etc/../lib/cache/gui/TableLayout/jars/TableLayout-bin-jdk1.5-2009-08-26.jar                                                                                                             
[ah403@tallinn /home/scratch/ome/components/tools/OmeroImageJ/Omero_ImageJ] %


I put all the jars into a folder and used that as my plugin.

These is no ome-tools.jar. Am I missing something from the official build process that would include ome-tools.jar?

As a test I have unpacked the OMERO ImageJ plugin, deleted ome-tools.jar and run the same import scenario. This works OK. So it appears that the ome-tools.jar contains some classes that do not work.

I tested this on a 32-bit and 64-bit Windows too. The same result. Excluding ome-tools.jar fixes it.

Regards,

Alex
a.herbert
 
Posts: 53
Joined: Tue Jan 11, 2011 1:35 pm

Re: ICE.UnmarshalOutOfBoundsException ImageJ plugin

Postby jmoore » Thu Aug 11, 2011 10:14 am

In the first, broken case, the files used are:
Code: Select all
/tmp/imagej $ perl -pe 's/^.*\sfrom\s(.*?)$/$1/' OMERO.ImageJ.recompiled.verbose.out  | sort | uniq -c
...
  69 file:/usr/local/ImageJ/ij.jar]
  36 file:/usr/local/ImageJ/plugins/OmeroImageJ/Omero_ImageJ.jar]
   4 file:/usr/local/ImageJ/plugins/OmeroImageJ/TableLayout.jar]
  15 file:/usr/local/ImageJ/plugins/OmeroImageJ/commons-logging.jar]
  31 file:/usr/local/ImageJ/plugins/OmeroImageJ/omero-clients-util.jar]
641 file:/usr/local/ImageJ/plugins/OmeroImageJ/omero_client.jar]
  24 file:/usr/local/ImageJ/plugins/loci_tools.jar]


and in the recompiled version:
Code: Select all
/tmp/imagej $ perl -pe 's/^.*\sfrom\s(.*?)$/$1/' OMERO.ImageJ.verbose.out  | sort | uniq -c
...
  72 file:/usr/local/ImageJ/ij.jar]
  36 file:/usr/local/ImageJ/plugins/OmeroImageJ/Omero_ImageJ.jar]
   4 file:/usr/local/ImageJ/plugins/OmeroImageJ/TableLayout.jar]
  15 file:/usr/local/ImageJ/plugins/OmeroImageJ/commons-logging.jar]
636 file:/usr/local/ImageJ/plugins/OmeroImageJ/ome-tools.jar]
  31 file:/usr/local/ImageJ/plugins/OmeroImageJ/omero-clients-util.jar]
  24 file:/usr/local/ImageJ/plugins/loci_tools.jar]


The missing omero_client.jar is most likely the culprit, since then older OMERO classes are being picked up from the loci_tools.jar. There was an issue with the 4.3.0 build. Could you try the 4.3.1 OMERO plugin and let us know how it goes?

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

Re: ICE.UnmarshalOutOfBoundsException ImageJ plugin

Postby a.herbert » Thu Aug 11, 2011 10:19 am

Hi Josh,

It seems that I have reinvented the wheel. This post explains your broken build in v4.3.0:

http://www.openmicroscopy.org/community/viewtopic.php?f=5&t=727

I checked the v4.3.1 plugin and it does not contain ome-tools.jar.

Thanks for the help.

Alex
a.herbert
 
Posts: 53
Joined: Tue Jan 11, 2011 1:35 pm

Re: ICE.UnmarshalOutOfBoundsException ImageJ plugin

Postby jmoore » Thu Aug 11, 2011 10:29 am

No problem. Glad the solution was as easy as that!
Cheers,
~Josh.
User avatar
jmoore
Site Admin
 
Posts: 1591
Joined: Fri May 22, 2009 1:29 pm
Location: Germany


Return to Developer Discussion

Who is online

Users browsing this forum: Google [Bot] and 1 guest