Skip to main content

[JAI-IMAGEIO] AccessControlException in ImageIO lookup

4 replies [Last post]

I'm seeing a bizarre exception that I don't know how to explain.

The core of the problem is that I'm seeing an AccessControlException
that says I don't have permission to read the property. The strack trace points
to PackageUtil.isCodecLibAvailable(). The mystifying thing is that this
code CATCHES a SecurityException and should default to false. This is
the code slice:

try {
property =

} catch(SecurityException se) {
// Do nothing: leave 'property' null.
return (property != null &&
property.equalsIgnoreCase("true")) ?
Boolean.TRUE : Boolean.FALSE;

As you can see, it should catch AccessControlException (which is a
subclass of SecurityException). For some reason, in one particular
deployment it doesn't. This is a huge problem because of what I believe
to be a bug in the core ImageIO that allows the failure to initialize
one ImageIO plugin to basically bring down the entire ImageIO class. I
get an ExceptionInInitializerError when the ImageIO class is first
referenced -- which results in its IIORegistry getting loaded, which
results in the JAI ImageIO tools plugins being loaded, which results in
this error. Since the ImageIO static initializer fails, the class is not
available for the rest of the life of the VM. Every future reference to
ImageIO.someStaticMethod() results in an exception.

The circumstances in which I've seen this happen are:

JAI ImageIO Tools 1.1
Solaris 10
JDK 1.5.0_11
Java Webstart signed application (i'm guessing this is related to the

One might argue that it's a deployment problem, but that still doesn't
explain how the exception itself could sneak through that catch block.
So there are two questions: why does the exception happen at all, and
why does it propagate outside this block?

The only thing I turned up in a google search that was remotely relevant
was this

but it's long and not tremendously helpful.

Has anyone seen a problem like this before?


To unsubscribe, e-mail:
For additional commands, e-mail:

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2007-03-17

We're seeing the exact same issue. Did you ever find a solution?

Joined: 2005-04-08

No, I haven't found any solution, and obviously nobody has replied on here...

Joined: 2004-06-23

> No, I haven't found any solution, and obviously
> nobody has replied on here...

I haven't a clue as to why this is happening. As you observed, the exception should be caught.


Joined: 2007-03-17

We got a workaround adding read permission to the java.policy file. This solution sucks but it seems to resolve the issue for us.