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 / General / August 2006

Tip: Looking for answers? Try searching our database.

java.security.AccessControlException

Thread view: 
Nancy.Nicole@gmail.com - 14 Aug 2006 21:11 GMT
I need to create an instance of a class that writes a file. I am
getting this exception:

basic: Stopping applet ...
basic: Removed progress listener:
sun.plugin.util.GrayBoxPainter@1157f77
basic: Finding information ...
basic: Releasing classloader: sun.plugin.ClassLoaderInfo@170888e,
refcount=0
basic: Caching classloader: sun.plugin.ClassLoaderInfo@170888e
basic: Current classloader cache size: 1
basic: Done ...
basic: Joining applet thread ...
basic: Destroying applet ...
basic: Disposing applet ...
basic: Quiting applet ...
basic: Joined applet thread ...
basic: Unregistered modality listener
basic: Registered modality listener
basic: Referencing classloader: sun.plugin.ClassLoaderInfo@170888e,
refcount=1
basic: Added progress listener: sun.plugin.util.GrayBoxPainter@a6faa9
basic: Loading applet ...
basic: Initializing applet ...
basic: Starting applet ...
java.security.AccessControlException: access denied
(java.io.FilePermission data.dat 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.checkRead(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at java.io.FileReader.<init>(Unknown Source)
    at DataAccess.load(DataAccess.java:11)
    at AddressBook32.<init>(AddressBook32.java:35)
    at Z115.init(Z115.java:107)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
basic: Exception: java.security.AccessControlException: access denied
(java.io.FilePermission data.dat read)
java.security.AccessControlException: access denied
(java.io.FilePermission data.dat 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.checkRead(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at java.io.FileInputStream.<init>(Unknown Source)
    at java.io.FileReader.<init>(Unknown Source)
    at DataAccess.load(DataAccess.java:11)
    at AddressBook32.<init>(AddressBook32.java:35)
    at Z115.init(Z115.java:107)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
basic: Modality pushed
basic: Modality popped
Exception in thread "thread applet-Z115.class"
java.lang.NullPointerException
    at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
    at sun.plugin.AppletViewer.showAppletException(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

I need to combat this exception. How do I do this?

Thanks.
Matt Humphrey - 14 Aug 2006 21:56 GMT
>I need to create an instance of a class that writes a file. I am
> getting this exception:
[quoted text clipped - 3 lines]
> sun.plugin.util.GrayBoxPainter@1157f77
> basic: Finding information ...

<snip exception top>

> basic: Starting applet ...
> java.security.AccessControlException: access denied
> (java.io.FilePermission data.dat read)
> at java.security.AccessControlContext.checkPermission(Unknown Source)

<snip exception remainder>

Applets (for very good reason) do not generally have permission to read or
write files on the user's machine.  Typically you must sign the applet,
request the permission and the user must grant it or you must otherwise
persuade the user to modify the JVM security policy to allow file access.
For details on signing, try http://mindprod.com/jgloss/signedapplets.html

Matt Humphrey matth@ivizNOSPAM.com http://www.iviz.com/


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.