0 Replies Latest reply: Nov 29, 2012 12:31 PM by 347627 RSS

    Problem with SPI ordering using Java 7

    347627
      Hello,

      We are having problems with migrating out JAI application to use Java 7. We are using 'jai-1_1_3-lib-linux-amd64.tar.gz' with java 1.7.0_03-b04 64-Bit on Linux.

      The issue we are seeing is that the JAI service providers are not being correctly prioritized ahead of the JRE providers. For example in Java 1.6 a call to:

      <pre>
      Iterator<ImageReader> readersIterator = ImageIO.getImageReadersByMIMEType("image/jpeg")
      </pre>

      Would result in the first result always being 'CLibJPEGImageReader' in 1.6, but in java 1.7 some times the first provider is 'JPEGImageReader'. I think I have root caused the problem to be that the 'com.sun.imageio.plugins.jpeg.JPEGImageReaderSpi' reports 'getVendorName()' as 'Oracle Corporation' where as 1.6 reports 'Sun Microsystems'. I believe the problem is in the getJDKImageReaderWriterSPI() of ImageUtil line 1364:

      http://dev.loci.wisc.edu/trac/software/browser/trunk/components/jai/src/...

      I am having a hard time finding if there is an update or workaround to this problem. Any help would be much appreciated.

      Thanks,
      Bryan