Results 1 to 3 of 3

Thread: AccessControlException (access denied)

  1. #1

    Thread Starter
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    AccessControlException (access denied)

    I can can use a BufferedReader to open a Streamat the command line, like this:
    Code:
    BufferedReader br = new BufferedReader(new InpuStreamReader(URL.openStream()));


    Once I try to use this same statement inside of my applet, I get an AccessControlException. I know it's something to do with security, but how do you get around that?

  2. #2
    Frenzied Member vbNeo's Avatar
    Join Date
    May 2002
    Location
    Jutland, Denmark
    Posts
    1,994

    Re: AccessControlException (access denied)

    Quote Originally Posted by System_Error
    I can can use a BufferedReader to open a Streamat the command line, like this:
    Code:
    BufferedReader br = new BufferedReader(new InpuStreamReader(URL.openStream()));


    Once I try to use this same statement inside of my applet, I get an AccessControlException. I know it's something to do with security, but how do you get around that?
    Code:
    BufferedReader br = new BufferedReader(new InputStreamReader(URL.openStream()));
    Your code needed a t in Input probably wasn't that though, since it threw an exception .

    Have you tried .printStackTrace() and attempted to trace the error?
    "Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
    - Zack de la Rocha


    Hear me roar.

  3. #3

    Thread Starter
    Frenzied Member System_Error's Avatar
    Join Date
    Apr 2004
    Posts
    1,111

    Re: AccessControlException (access denied)

    Well, I finally found out what it was. I knew that applets didn't allow you access files and junk, but I never knew that trying to read from a url connection would cause problems. I did it at the console, and it worked. But for some reason applets have restriction to what I was trying to do.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width