Skip to main content

How to use ImageIO tools in APPLET?

3 replies [Last post]
malm
Offline
Joined: 2006-05-29
Points: 0

I need to display a TIFF file in an applet. So I downloaded and installed the JAI Image IO tools but it doesn't work in my applet because of Bug 5076692, that is applets don't pick up plugins installed in the ext dir.

While this seems to be fixed in JDK 1.6, mustang, build 56 or greater, this doesn't help me as my customer will not run beta software in their production environments.

Is there a workaround (apart from granting AllPermissions in the java.policy file to everything) which will make ImageIO plugins installed in the ext dir work in applets for the current released JREs?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
malm
Offline
Joined: 2006-05-29
Points: 0

Thanks Marco - just a day ago I ran the automatic update from the Java Control Panel and it updated me to 1.5.0_06. So I was not aware that 07 is available (automatic update still does not find it but manual update works).

Any way, yes the codecs in the ext dir are now visible to my applet but I can't use them:

java.security.AccessControlException: access denied (java.lang.RuntimePermission loadLibrary.clib_jiio)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkLink(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at com.sun.medialib.codec.jpeg.Decoder.(Decoder.java:261)

Now even my JPEGs and PNGs don't display in the applet which they happily did under _06. Under _06 the ext dir was not visible to the applet so it used the standard JRE codecs for these formats.

This seems a very nasty regression. Any one who uses an applet that displays images using ImageIO and who upgrades to 07 and installs the JAI ImageIO tools will not be able to use the applet any more.

So my problem remains, the codecs although now visible to the applet remain unuseable.

Marco Sambin - NeoLogica

Hi,

yes, now the problem seems to be that your applet does not have enough
privileges to load the native library portion of the Image I/O tools. This
problem should disappear if you digitally sign your applet JAR file: did you
try this step?

Regards,

Marco.

-----Original Message-----
From: jai-imageio@javadesktop.org [mailto:jai-imageio@javadesktop.org]
Sent: martedì 30 maggio 2006 14.25
To: interest@jai-imageio.dev.java.net
Subject: [JAI-IMAGEIO] Re: How to use ImageIO tools in APPLET?

Thanks Marco - just a day ago I ran the automatic update from the Java
Control Panel and it updated me to 1.5.0_06. So I was not aware that 07 is
available (automatic update still does not find it but manual update works).

Any way, yes the codecs in the ext dir are now visible to my applet but I
can't use them:

java.security.AccessControlException: access denied
(java.lang.RuntimePermission loadLibrary.clib_jiio)
at java.security.AccessControlContext.checkPermission(Unknown
Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkLink(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at com.sun.medialib.codec.jpeg.Decoder.(Decoder.java:261)

Now even my JPEGs and PNGs don't display in the applet which they happily
did under _06. Under _06 the ext dir was not visible to the applet so it
used the standard JRE codecs for these formats.

This seems a very nasty regression. Any one who uses an applet that displays
images using ImageIO and who upgrades to 07 and installs the JAI ImageIO
tools will not be able to use the applet any more.

So my problem remains, the codecs although now visible to the applet remain
unuseable.
[Message sent by forum member 'malm' (malm)]

http://forums.java.net/jive/thread.jspa?messageID=117290

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

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

Marco Sambin - NeoLogica

Hi.

The bug you are referring to seems to have been fixed in JRE 1.5.0_07. Take
a look at:

http://java.sun.com/j2se/1.5.0/ReleaseNotes.html

Or, as an alternative, you may want to sign your applet JAR file: signed
applets have by default enough privileges to allow the usage of JAI Image
I/O reader/writer plugins.

Hope it helps.

Regards,

Marco.

-----Original Message-----
From: jai-imageio@javadesktop.org [mailto:jai-imageio@javadesktop.org]
Sent: martedì 30 maggio 2006 5.46
To: interest@jai-imageio.dev.java.net
Subject: [JAI-IMAGEIO] How to use ImageIO tools in APPLET?

I need to display a TIFF file in an applet. So I downloaded and installed
the JAI Image IO tools but it doesn't work in my applet because of Bug
5076692, that is applets don't pick up plugins installed in the ext dir.

While this seems to be fixed in JDK 1.6, mustang, build 56 or greater, this
doesn't help me as my customer will not run beta software in their
production environments.

Is there a workaround (apart from granting AllPermissions in the java.policy
file to everything) which will make ImageIO plugins installed in the ext dir
work in applets for the current released JREs?
[Message sent by forum member 'malm' (malm)]

http://forums.java.net/jive/thread.jspa?messageID=117226

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

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