United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-5076692 Installed Extensions Image I/O reader-writer plug-ins unusable in applet context
JDK-5076692 : Installed Extensions Image I/O reader-writer plug-ins unusable in applet context

Details
Type:
Bug
Submit Date:
2004-07-21
Status:
Resolved
Updated Date:
2005-10-10
Project Name:
JDK
Resolved Date:
2005-10-10
Component:
client-libs
OS:
generic,windows_2000
Sub-Component:
javax.imageio
CPU:
x86,generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
1.0_01,5.0
Fixed Versions:

Related Reports
Backport:

Sub Tasks

Description
Image I/O Plugins provided as part of an extension installed into the JDK don't seem to be picked in an applet environment.

A simple test case demonstrating this is attached.

To run, first JAI Image I/O tools needs to be installed. This can be downloaded from here

http://java.sun.com/developer/earlyAccess/jai_imageio/index.html

Installation instructions are outlined here

http://java.sun.com/developer/earlyAccess/jai_imageio/INSTALL-jai_imageio.html

Look under "Installation in a JRE" heading

Once you have this installed, to try this out in an application environment, simply run "java IIOAppletTest" and you should see this output

Reader names:
tif tiff JPEG-LOSSLESS jfif wbmp jpeg-lossless jpeg2000 gif WBMP BMP bmp jpeg-ls JPEG 2000 TIF JPEG2000 JPG PNG JPEG raw PNM jpeg RAW jpeg 2000 pnm TIFF JPEG-LS png jpg JFIF
Reader Mime Types:
image/x-portable-graymap image/jpeg image/x-portable-pixmap image/x-portable-anymap image/png image/x-png image/jpeg2000 image/tiff image/vnd.wap.wbmp image/bmp image/x-portable-bitmap image/gif

Running as an applet, "appletviewer IIOAppletTest.html" gives the following output, not reporting any of the extension reader/writer plugins

Reader names:
BMP bmp jpeg wbmp gif png JPG jpg WBMP JPEG
Reader Mime Types:
image/png image/jpeg image/x-png image/vnd.wap.wbmp image/bmp image/gif Reader names:
BMP bmp jpeg wbmp gif png JPG jpg WBMP JPEG
Reader Mime Types:
image/png image/jpeg image/x-png image/vnd.wap.wbmp image/bmp image/gif

This seems to indicate that plugins from installed extensions are not picked up in an applet environment.

                                    

Comments
EVALUATION

Serious issue that prevents applets from making use of the JAI IIO Tools
plugins.  It seems that we are not loading the plugins installed in
jre/lib/ext through the IIORegistry; could be that we're using the wrong
ClassLoader to look for the plugin classes.  Should be investigated for
Dragonfly, if not sooner.
###@###.### 2004-07-21
                                     
2004-07-21
PUBLIC COMMENTS

Installed Extensions Image I/O reader-writer plug-ins unusable in applet context
                                     
2004-08-21
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
dragon


                                     
2004-08-21
EVALUATION

The problem is: the imageio registry initialization code do not have read
access to jars in the java.ext.dirs when it is called form applet context.
Therefore, imageio plugins installed to java.ext.dirs are not available
in case of applets.

The fix idea is to register plugins from java.ext.dirs in the privileged
action block.

Unfortunately, this fix has some bad side effect - we will read jars in the
java.ext.dirs twice:
first time when we register services available in current thread context
(IIORegistry.java, lines 182-185) and second time when we register installed
services (lines 203-206).
It was made in order to avoid the loading of plugins which
is available in the application classpath in the privileged mode.
                                     
2005-09-26



Hardware and Software, Engineered to Work Together