Skip to main content

[JAI-IMAGEIO] AccessControlException in ImageIO lookup

4 replies [Last post]
Anonymous

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
com.sun.media.imageio.disableCodecLib 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 =

System.getProperty("com.sun.media.imageio.disableCodecLib");
} 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
problem)

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

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6421652

but it's long and not tremendously helpful.

Has anyone seen a problem like this before?

Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: interest-unsubscribe@jai-imageio.dev.java.net
For additional commands, e-mail: interest-help@jai-imageio.dev.java.net

Reply viewing options

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

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

mnidel
Offline
Joined: 2005-04-08
Points: 0

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

bpb
Offline
Joined: 2004-06-23
Points: 0

> 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.

Brian

mortac8
Offline
Joined: 2007-03-17
Points: 0

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