Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-1619

IIOImageProvider not working properly on JDK 11

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 4.0.0.Beta7, 3.6.3.Final
    • None
    • jaxrs
    • None

      IIOImageProvider does not work properly with PNG images when running on JDK 11.
      The org.jboss.resteasy.test.providers.iioimage.IIOImageProviderTest fails due to the following exception on server side:

      Caused by: java.lang.IllegalStateException: Compression mode not MODE_EXPLICIT!
              at java.desktop/javax.imageio.ImageWriteParam.setCompressionQuality(ImageWriteParam.java:1239)
              at org.jboss.resteasy.plugins.providers.IIOImageProvider.writeTo(IIOImageProvider.java:148)
              at org.jboss.resteasy.plugins.providers.IIOImageProvider.writeTo(IIOImageProvider.java:35)
              at org.jboss.resteasy.core.interception.jaxrs.AbstractWriterInterceptorContext.writeTo(AbstractWriterInterceptorContext.java:137)
              at org.jboss.resteasy.core.interception.jaxrs.ServerWriterInterceptorContext.writeTo(ServerWriterInterceptorContext.java:61)
              at org.jboss.resteasy.core.interception.jaxrs.AbstractWriterInterceptorContext.proceed(AbstractWriterInterceptorContext.java:124)
              at org.jboss.resteasy.security.doseta.DigitalSigningInterceptor.aroundWriteTo(DigitalSigningInterceptor.java:120)
              at org.jboss.resteasy.core.interception.jaxrs.AbstractWriterInterceptorContext.proceed(AbstractWriterInterceptorContext.java:129)
              at org.jboss.resteasy.core.ServerResponseWriter.writeNomapResponse(ServerResponseWriter.java:132)
              at org.jboss.resteasy.core.SynchronousDispatcher.writeResponse(SynchronousDispatcher.java:469)
              ... 43 more
      

      This has to do with com.sun.imageio.plugins.png.PNGImageWriteParam canWriteCompressed() method returning true while it used to return false on previous JDK versions. That is likely related to https://bugs.openjdk.java.net/browse/JDK-6488522 (see also http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/6648f64ba30a)

              rhn-support-asoldano Alessio Soldano
              rhn-support-asoldano Alessio Soldano
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: