Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PLEASE HELP ME with security in java applet

84 views
Skip to first unread message

aallee83

unread,
Dec 23, 2003, 9:25:27 AM12/23/03
to
The following is the error response from the console.
I need to use an applet using JAI libraries but there are security
problems.
Someone can help me?!?!? this applet work properly in netbeans!!!

java.lang.ExceptionInInitializerError

at javax.media.jai.OpImage.<init>(OpImage.java:230)

at javax.media.jai.PointOpImage.<init>(PointOpImage.java:374)

at javax.media.jai.PointOpImage.<init>(PointOpImage.java:404)

at javax.media.jai.NullOpImage.<init>(NullOpImage.java:108)

at javax.media.jai.NullOpImage.<init>(NullOpImage.java:156)

at VisorTiff.init(VisorTiff.java:46)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

Caused by: java.security.AccessControlException: access denied
(java.util.PropertyPermission java.home read)

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.checkPropertyAccess(Unknown Source)

at java.lang.System.getProperty(Unknown Source)

at com.sun.media.jai.util.PropertyUtil$1.run(PropertyUtil.java:99)

at java.security.AccessController.doPrivileged(Native Method)

at com.sun.media.jai.util.PropertyUtil.getFileFromClasspath(PropertyUtil.java:124)

at javax.media.jai.OperationRegistry.initializeRegistry(OperationRegistry.java:360)

at javax.media.jai.JAI.<clinit>(JAI.java:382)

... 8 more

Roger

unread,
Dec 24, 2003, 3:57:14 AM12/24/03
to
Your applet is requesting a permissionthat is not available by
default. The permission it wants to use is the ability to read the
java.home property.

Look for a .java.policy file in your home directory (in win2k this is
probably "C:\Documents and settings\yourusername", on *nix it is just
'~'). If you don't already have one then create an empty one and put
this in it:

grant {
permission java.util.PropertyPermission "java.home" "read";
};

This will make all your applets able to read java.home, which is maybe
a bit more drastic than you want to do, but it will get you going
quickly.

To really fix this you want to sign the applet jar (you'll need to
look that up, it is complicated). Once you have it signed your browser
will prompt you for permission to run it. If you say 'Yes' you give
that applet all permissions (again more drastic than you need), but it
will work okay.

So what you do next is modify the .java.policy to say:

grant signedBy "yourkeyword", codeBase
"https://yourweblocation/yourjarfile.jar" {
permission java.util.PropertyPermission "java.home" "read";
};

When this is in place the browser does not prompt, it just delivers
the required permission and no others. You can add others as
necessary. You may need to do all of this (sign the jar and then add a
'grant' entry for it) for every jar file you have in your applet.

0 new messages