-
Bug
-
Resolution: Fixed
-
P3
-
1.4.2
-
b63
-
generic
-
solaris_9
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2131999 | 5.0u7 | Andrew Brygin | P3 | Resolved | Fixed | b01 |
I was doing some testing with our app and noticed that if I removing an
ImageIO plugin's code from the classpath, but still include an entry for
the plugin's ImageReader in META-INF/services, I am no longer able to
use ANY of the ImageIO plugins.
I'm using JDK1.4.2_09. I get a NoClassDefFoundError upon running the
following:
String[] names = ImageIO.getReaderFormatNames();
The reason I'm getting a
NoClassDefFoundError at this line is because of a failure in
the static initializer of the ImageIO class. It's calling the
IIORegistry, which is trying to iterate over the available
ImageReaders. Since I've removed the plugin code from the classpath,
the registry gets an error when trying to load the class for
the particular plugin.
This to me seems to be a serious problem. Failure of a single
plugin brings the whole ImageIO plugin system down. This puts
the plugin architecture at the mercy of any malicious or
careless developer who might misconfigure their plugin and
thus disable all other plugins.
Naturally, it would be nice to know when a single plugin has
failed to load, but it seems this error should be caught so
that other plugins could continue to load properly.
Here's the stack trace down to the point where it leaves our code
and goes into the J2SE code:
sun.misc.ServiceConfigurationError: javax.imageio.spi.ImageWriterSpi:
Provider com.lmco.imageio.nitf.NITFImageWriterSpi not found
at sun.misc.Service.fail(Service.java:129)
at sun.misc.Service.access$000(Service.java:111)
at sun.misc.Service$LazyIterator.next(Service.java:272)
at
javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(IIORegist
ry.java:174)
at javax.imageio.spi.IIORegistry.<init>(IIORegistry.java:113)
at
javax.imageio.spi.IIORegistry.getDefaultInstance(IIORegistry.java:134)
at javax.imageio.ImageIO.<clinit>(ImageIO.java:46)
ImageIO plugin's code from the classpath, but still include an entry for
the plugin's ImageReader in META-INF/services, I am no longer able to
use ANY of the ImageIO plugins.
I'm using JDK1.4.2_09. I get a NoClassDefFoundError upon running the
following:
String[] names = ImageIO.getReaderFormatNames();
The reason I'm getting a
NoClassDefFoundError at this line is because of a failure in
the static initializer of the ImageIO class. It's calling the
IIORegistry, which is trying to iterate over the available
ImageReaders. Since I've removed the plugin code from the classpath,
the registry gets an error when trying to load the class for
the particular plugin.
This to me seems to be a serious problem. Failure of a single
plugin brings the whole ImageIO plugin system down. This puts
the plugin architecture at the mercy of any malicious or
careless developer who might misconfigure their plugin and
thus disable all other plugins.
Naturally, it would be nice to know when a single plugin has
failed to load, but it seems this error should be caught so
that other plugins could continue to load properly.
Here's the stack trace down to the point where it leaves our code
and goes into the J2SE code:
sun.misc.ServiceConfigurationError: javax.imageio.spi.ImageWriterSpi:
Provider com.lmco.imageio.nitf.NITFImageWriterSpi not found
at sun.misc.Service.fail(Service.java:129)
at sun.misc.Service.access$000(Service.java:111)
at sun.misc.Service$LazyIterator.next(Service.java:272)
at
javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(IIORegist
ry.java:174)
at javax.imageio.spi.IIORegistry.<init>(IIORegistry.java:113)
at
javax.imageio.spi.IIORegistry.getDefaultInstance(IIORegistry.java:134)
at javax.imageio.ImageIO.<clinit>(ImageIO.java:46)
- backported by
-
JDK-2131999 Image I/O plugin failure causes all readers to fail
- Resolved
- relates to
-
JDK-6677403 AccessControlException in ImageIO static initializer on Solaris 10 with JAI Tools extension
- Closed