Omero Insight 5.5.12 cannot import jpeg

Good morning,

We have recently upgraded our OMERO server to 5.6 and our OMERO.insight to 5.5.12 and are using Java 11 on our OMERO server. When we try and import jpeg files we get the following error:

java.lang.RuntimeException: Failure response on import!
Category: ::omero::grid::ImportRequest
Name: error-on-init
Parameters: {stacktrace=java.lang.NoClassDefFoundError: Could not initialize class com.sun.imageio.plugins.jpeg.JPEGImageReader
	at java.desktop/com.sun.imageio.plugins.jpeg.JPEGImageReaderSpi.createReaderInstance(JPEGImageReaderSpi.java:85)
	at java.desktop/javax.imageio.spi.ImageReaderSpi.createReaderInstance(ImageReaderSpi.java:320)
	at java.desktop/javax.imageio.ImageIO$ImageReaderIterator.next(ImageIO.java:532)
	at java.desktop/javax.imageio.ImageIO$ImageReaderIterator.next(ImageIO.java:516)
	at java.desktop/javax.imageio.ImageIO.read(ImageIO.java:1463)
	at java.desktop/javax.imageio.ImageIO.read(ImageIO.java:1363)
	at loci.formats.in.ImageIOReader.initImage(ImageIOReader.java:148)
	at loci.formats.in.ImageIOReader.initFile(ImageIOReader.java:121)
	at loci.formats.in.JPEGReader$DefaultJPEGReader.initFile(JPEGReader.java:203)
	at loci.formats.FormatReader.setId(FormatReader.java:1392)
	at loci.formats.DelegateReader.setId(DelegateReader.java:291)
	at loci.formats.in.JPEGReader.setId(JPEGReader.java:87)
	at loci.formats.ImageReader.setId(ImageReader.java:849)
	at ome.formats.importer.OMEROWrapper$4.setId(OMEROWrapper.java:167)
	at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:650)
	at loci.formats.ChannelFiller.setId(ChannelFiller.java:223)
	at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:650)
	at loci.formats.ChannelSeparator.setId(ChannelSeparator.java:293)
	at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:650)
	at loci.formats.Memoizer.setId(Memoizer.java:690)
	at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:650)
	at ome.services.blitz.repo.CheckedPath.bfSetId(CheckedPath.java:412)
	at ome.services.blitz.repo.ManagedImportRequestI.open(ManagedImportRequestI.java:763)
	at ome.services.blitz.repo.ManagedImportRequestI.init(ManagedImportRequestI.java:245)
	at omero.cmd.HandleI.steps(HandleI.java:438)
	at omero.cmd.HandleI$RunSteps.innerWork(HandleI.java:509)
	at omero.cmd.HandleI$2.doWork(HandleI.java:383)
	at omero.cmd.HandleI$2.doWork(HandleI.java:380)
	at jdk.internal.reflect.GeneratedMethodAccessor282.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
	at ome.services.util.Executor$Impl$Interceptor.invoke(Executor.java:568)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at ome.security.basic.EventHandler.invoke(EventHandler.java:154)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.orm.hibernate3.HibernateInterceptor.invoke(HibernateInterceptor.java:119)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at ome.tools.hibernate.ProxyCleanupFilter$Interceptor.invoke(ProxyCleanupFilter.java:249)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at ome.services.util.ServiceHandler.invoke(ServiceHandler.java:121)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
	at com.sun.proxy.$Proxy81.doWork(Unknown Source)
	at ome.services.util.Executor$Impl.execute(Executor.java:447)
	at omero.cmd.HandleI.run(HandleI.java:379)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at ome.services.util.Executor$Impl$1.call(Executor.java:488)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
, message=Could not initialize class com.sun.imageio.plugins.jpeg.JPEGImageReader}

	at ome.formats.importer.ImportLibrary$ImportCallback.onFinished(ImportLibrary.java:807)
	at omero.cmd.CmdCallbackI.finished(CmdCallbackI.java:334)
	at omero.cmd.CmdCallbackI.poll(CmdCallbackI.java:316)
	at omero.cmd.CmdCallbackI$1.run(CmdCallbackI.java:151)

	at org.openmicroscopy.shoola.env.data.util.Status.update(Status.java:615)
	at ome.formats.importer.ImportLibrary.notifyObservers(ImportLibrary.java:297)
	at ome.formats.importer.ImportLibrary$ImportCallback.onFinished(ImportLibrary.java:813)
	at omero.cmd.CmdCallbackI.finished(CmdCallbackI.java:334)
	at omero.cmd.CmdCallbackI.poll(CmdCallbackI.java:316)
	at omero.cmd.CmdCallbackI$1.run(CmdCallbackI.java:151)
Caused by: java.lang.RuntimeException: Failure response on import!
Category: ::omero::grid::ImportRequest
Name: error-on-init
Parameters: {stacktrace=java.lang.NoClassDefFoundError: Could not initialize class com.sun.imageio.plugins.jpeg.JPEGImageReader
	at java.desktop/com.sun.imageio.plugins.jpeg.JPEGImageReaderSpi.createReaderInstance(JPEGImageReaderSpi.java:85)
	at java.desktop/javax.imageio.spi.ImageReaderSpi.createReaderInstance(ImageReaderSpi.java:320)
	at java.desktop/javax.imageio.ImageIO$ImageReaderIterator.next(ImageIO.java:532)
	at java.desktop/javax.imageio.ImageIO$ImageReaderIterator.next(ImageIO.java:516)
	at java.desktop/javax.imageio.ImageIO.read(ImageIO.java:1463)
	at java.desktop/javax.imageio.ImageIO.read(ImageIO.java:1363)
	at loci.formats.in.ImageIOReader.initImage(ImageIOReader.java:148)
	at loci.formats.in.ImageIOReader.initFile(ImageIOReader.java:121)
	at loci.formats.in.JPEGReader$DefaultJPEGReader.initFile(JPEGReader.java:203)
	at loci.formats.FormatReader.setId(FormatReader.java:1392)
	at loci.formats.DelegateReader.setId(DelegateReader.java:291)
	at loci.formats.in.JPEGReader.setId(JPEGReader.java:87)
	at loci.formats.ImageReader.setId(ImageReader.java:849)
	at ome.formats.importer.OMEROWrapper$4.setId(OMEROWrapper.java:167)
	at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:650)
	at loci.formats.ChannelFiller.setId(ChannelFiller.java:223)
	at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:650)
	at loci.formats.ChannelSeparator.setId(ChannelSeparator.java:293)
	at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:650)
	at loci.formats.Memoizer.setId(Memoizer.java:690)
	at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:650)
	at ome.services.blitz.repo.CheckedPath.bfSetId(CheckedPath.java:412)
	at ome.services.blitz.repo.ManagedImportRequestI.open(ManagedImportRequestI.java:763)
	at ome.services.blitz.repo.ManagedImportRequestI.init(ManagedImportRequestI.java:245)
	at omero.cmd.HandleI.steps(HandleI.java:438)
	at omero.cmd.HandleI$RunSteps.innerWork(HandleI.java:509)
	at omero.cmd.HandleI$2.doWork(HandleI.java:383)
	at omero.cmd.HandleI$2.doWork(HandleI.java:380)
	at jdk.internal.reflect.GeneratedMethodAccessor282.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
	at ome.services.util.Executor$Impl$Interceptor.invoke(Executor.java:568)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at ome.security.basic.EventHandler.invoke(EventHandler.java:154)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.orm.hibernate3.HibernateInterceptor.invoke(HibernateInterceptor.java:119)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
	at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282)
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at ome.tools.hibernate.ProxyCleanupFilter$Interceptor.invoke(ProxyCleanupFilter.java:249)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at ome.services.util.ServiceHandler.invoke(ServiceHandler.java:121)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)
	at com.sun.proxy.$Proxy81.doWork(Unknown Source)
	at ome.services.util.Executor$Impl.execute(Executor.java:447)
	at omero.cmd.HandleI.run(HandleI.java:379)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at ome.services.util.Executor$Impl$1.call(Executor.java:488)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
, message=Could not initialize class com.sun.imageio.plugins.jpeg.JPEGImageReader}

	at ome.formats.importer.ImportLibrary$ImportCallback.onFinished(ImportLibrary.java:807)
	... 3 more`

I have read on stackoverflow that perhaps Java11 is no longer using the JPEGreader class but am unsure.

I am attaching an example of a jpeg file we tried to upload. Is it that you could help me to know how to fix this issue?

Thank you for your time

Hi @kiwimist8,

thanks for the detailed exception and the sample files. I have labelled the post with bio-formats as the stack trace indicates the issue arises at that level.

It is very likely to be related to the Java environment as suggested by previous occurrences of this exception - see e.g. here or here for a previous Bio-Formats ticket.

I have tried to reproduce your stack trace in the following Java 11 environment:

$ java --version
openjdk 11.0.8 2020-07-14
OpenJDK Runtime Environment 18.9 (build 11.0.8+10)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.8+10, mixed mode)

Which versions of Java and which operating system are running on your server? Also which version of OMERO.server is installed?

Hi,

Thanks for your quick reply. Yes, I think i had come across those same pages, but as they seem to apply to a Java 8 version, i wasn’t sure what was the best course of action. The stats are as follows:

Java:
openjdk 11.0.8 2020-07-14 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.8+10-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.8+10-LTS, mixed mode, sharing)

OS: CentOS Linux release 7.8.2003 (Core)

OMERO.server: 5.6.2

I can import your image with the latest OMERO trunk on Debian with OpenJDK 1.8.0_265, 11.0.2, and 11.0.8 (2020-07-14, like yours), it looks just as you show above. I wonder what’s different. Could there be some JAI ImageIO installation around or somesuch?

In addition to Mark’s testing, I worked on reproducing the initial workflow in a Docker-based CentOS7/JDK11/OMERO 5.6 environment created using https://github.com/ome/docker-example-omero

bash-4.2$ cat /etc/redhat-release 
CentOS Linux release 7.8.2003 (Core)
bash-4.2$ java -version
openjdk version "11.0.8" 2020-07-14 LTS
OpenJDK Runtime Environment 18.9 (build 11.0.8+10-LTS)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.8+10-LTS, mixed mode, sharing)

Importing the sample jpeg file linked above worked without issue and the imaging data could be accessed by the viewer