Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8154860

ImageIO.getImageReadersByFormatName() fails when jai_imageio is in the classpath

    Details

    • Subcomponent:
    • Resolved In Build:
      b124
    • CPU:
      x86_64
    • OS:
      windows_7

      Description

      FULL PRODUCT VERSION :
      java version "9-ea"
      Java(TM) SE Runtime Environment (build 9-ea+114)
      Java HotSpot(TM) 64-Bit Server VM (build 9-ea+114, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      ImageIO.getImageReadersByFormatName("JPEG");

      fails, but only if jai_imageio.jar (version 1.1, file size 1140632) is in the class path.





      REGRESSION. Last worked in version 8u91

      ADDITIONAL REGRESSION INFORMATION:
      java version "1.8.0_91"
      Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      compile the code on jdk8, then run it on jdk9:

      "C:\Program Files\Java\jre-9\bin\java" -cp "XXXX\JDK9Test\dist\JDK9Test.jar;XXXX\lib\*" jdk9test.JDK9Test

      and have jai_imageio.jar in the lib directory

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      normal end
      ACTUAL -
      a stack trace

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Exception in thread "main" java.lang.ExceptionInInitializerError
      at jdk9test.JDK9Test.main(JDK9Test.java:11)
      Caused by: java.lang.NumberFormatException: For input string: ""
      at java.lang.NumberFormatException.forInputString(java.base@9-ea/NumberFormatException.java:65)
      at java.lang.Integer.parseInt(java.base@9-ea/Integer.java:705)
      at java.lang.Integer.parseInt(java.base@9-ea/Integer.java:813)
      at com.sun.media.imageioimpl.common.ImageUtil.processOnRegistration(ImageUtil.java:1408)
      at com.sun.media.imageioimpl.plugins.wbmp.WBMPImageReaderSpi.onRegistration(WBMPImageReaderSpi.java:95)
      at javax.imageio.spi.SubRegistry.registerServiceProvider(java.desktop@9-ea/ServiceRegistry.java:773)
      at javax.imageio.spi.ServiceRegistry.registerServiceProvider(java.desktop@9-ea/ServiceRegistry.java:328)
      at javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(java.desktop@9-ea/IIORegistry.java:214)
      at javax.imageio.spi.IIORegistry.<init>(java.desktop@9-ea/IIORegistry.java:138)
      at javax.imageio.spi.IIORegistry.getDefaultInstance(java.desktop@9-ea/IIORegistry.java:159)
      at javax.imageio.ImageIO.<clinit>(java.desktop@9-ea/ImageIO.java:66)
      ... 1 more


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      package jdk9test;

      import java.util.Iterator;
      import javax.imageio.ImageIO;
      import javax.imageio.ImageReader;

      public class JDK9Test
      {
          public static void main(String[] args)
          {
              ImageIO.getImageReadersByFormatName("JPEG");
          }
      }

      ---------- END SOURCE ----------

        Attachments

          Activity

            People

            • Assignee:
              prr Philip Race
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: