Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Security / December 2003

Tip: Looking for answers? Try searching our database.

PLEASE HELP ME with security in java applet

Thread view: 
aallee83 - 23 Dec 2003 14:25 GMT
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 - 24 Dec 2003 08:57 GMT
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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.