Access Permission

Discussion in 'Java' started by Ken Kast, Jun 8, 2004.

  1. Ken Kast

    Ken Kast Guest

    I've written a small applet that reads and parses various XML files on the
    server and creates Documents that are to be manipulated by javascript on the
    client. It uses standard javax.xml.* packages out of 1.4.2_04. The applet
    and XML files are in a subfolder of the directory where the web page is.
    The applet works OK in an applet viewer in the IDE, but when I try to run it
    in the browser I get the following error message in the console:

    Exception while creating stream: access denied (java.io.FilePermission
    C:\Documents and Settings\Ken\My Documents\My
    Webs\kenkast\NewsReader\applets\default.opml read)

    Here's the code that causes the exception:
    public Document XDoc(URL url) {
    Document doc = null;
    Utilities.msg("XDoc URL: " + url);
    try {
    Utilities.msg("Try to get a stream");
    InputStream in = url.openStream(); // Error occurs here
    Utilities.msg("Got a stream");
    BufferedInputStream bis = new BufferedInputStream(in);

    Here are the two messages before the exception:
    XDoc URL:
    file:/C:/Documents%20and%20Settings/Ken/My%20Documents/My20Webs/kenkast/NewsReader/applets/default.opml
    Try to get a stream

    (NewsReader is where the html is.)

    Can someone tell me why this doesn't work?

    Thanks.
     
    Ken Kast, Jun 8, 2004
    #1
    1. Advertising

  2. On Tue, 08 Jun 2004 03:25:06 GMT, Ken Kast wrote:

    > I've written a small applet that..

    ...
    > Exception while creating stream: access denied (java.io.FilePermission

    ...
    > Can someone tell me why this doesn't work?


    An applet must be signed to do use files..
    <http://www.physci.org/codes/javafaq.jsp#jws>
    <http://www.physci.org/codes/javafaq.jsp#jar>

    --
    Andrew Thompson
    http://www.PhySci.org/ Open-source software suite
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.1point1C.org/ Science & Technology
     
    Andrew Thompson, Jun 8, 2004
    #2
    1. Advertising

  3. Ken Kast

    Ken K Guest

    Andrew Thompson <> wrote in message news:<3ez8gxz9g4bm.58zptpt6ba5p$>...
    > On Tue, 08 Jun 2004 03:25:06 GMT, Ken Kast wrote:
    >
    > > I've written a small applet that..

    > ..
    > > Exception while creating stream: access denied (java.io.FilePermission

    > ..
    > > Can someone tell me why this doesn't work?

    >
    > An applet must be signed to do use files..
    > <http://www.physci.org/codes/javafaq.jsp#jws>
    > <http://www.physci.org/codes/javafaq.jsp#jar>


    I am confused. I thought browser security policy let an unsigned
    applet access its directory and any subdirectories on the server. In
    this case the "server" is my hard drive. I've tried my applet and
    html on my site (kenkast.com) with exactly the same effect.

    Ken
     
    Ken K, Jun 8, 2004
    #3
  4. On 8 Jun 2004 09:42:01 -0700, Ken K wrote:

    > Andrew Thompson <> wrote in message news:<3ez8gxz9g4bm.58zptpt6ba5p$>...
    >> On Tue, 08 Jun 2004 03:25:06 GMT, Ken Kast wrote:
    >>
    >>> I've written a small applet that..

    >> ..
    >>> Exception while creating stream: access denied (java.io.FilePermission

    >> ..
    >>> Can someone tell me why this doesn't work?

    >>
    >> An applet must be signed to do use files..
    >> <http://www.physci.org/codes/javafaq.jsp#jws>
    >> <http://www.physci.org/codes/javafaq.jsp#jar>

    >
    > I am confused. I thought browser security policy let an unsigned
    > applet access its directory and any subdirectories on the server.


    Yes. You are confused. ;-)

    Do you think that you running the policytool
    on your IE could change what an applet coming
    from my site would allow you to do on my server?

    I went hunting at Sun for PolicyTool and found this first hit..
    <http://java.sun.com/developer/onlineTraining/Security/Fundamentals/magercises/Policytool/>
    Note the use of the word 'local' in first sentence..

    [ Search facilities are wonderful things, no? ;-) ]

    --
    Andrew Thompson
    http://www.PhySci.org/ Open-source software suite
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.1point1C.org/ Science & Technology
     
    Andrew Thompson, Jun 8, 2004
    #4
    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. Brent Bigler
    Replies:
    4
    Views:
    2,200
    Morgan
    Dec 20, 2003
  2. ryu
    Replies:
    1
    Views:
    375
    Hans Kesting
    Apr 1, 2005
  3. ElGordo
    Replies:
    1
    Views:
    2,281
    peabrain
    Nov 14, 2007
  4. William LaMartin
    Replies:
    2
    Views:
    6,604
    William LaMartin
    Jan 6, 2006
  5. news.microsoft.com

    access database permission problem

    news.microsoft.com, Jan 19, 2006, in forum: ASP .Net
    Replies:
    8
    Views:
    4,449
    jeeperinaz
    Jan 24, 2010
Loading...

Share This Page