java.security.AccessControlException

Discussion in 'Java' started by Nancy.Nicole@gmail.com, Aug 14, 2006.

  1. Guest

    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.
    , Aug 14, 2006
    #1
    1. Advertising

  2. <> wrote in message
    news:...
    >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 ...


    <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 http://www.iviz.com/
    Matt Humphrey, Aug 14, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Thanasis \(sch\)
    Replies:
    0
    Views:
    5,473
    Thanasis \(sch\)
    Mar 1, 2004
  2. BADBOY
    Replies:
    8
    Views:
    6,666
    Roedy Green
    Jul 12, 2004
  3. nandu
    Replies:
    3
    Views:
    644
    nandu
    Dec 18, 2006
  4. Z
    Replies:
    3
    Views:
    1,548
  5. merrittr
    Replies:
    10
    Views:
    1,280
    merrittr
    Mar 25, 2007
Loading...

Share This Page