[5481] in java-interest

home help back first fref pref prev next nref lref last post

Re: SecurityException error

daemon@ATHENA.MIT.EDU (JoanMa MAS RIBES)
Mon Feb 12 15:45:18 1996

Date: Mon, 12 Feb 1996 10:16:26 +0100
From: JoanMa MAS RIBES <mas@tele.ucl.ac.be>
To: Kenneth Cheng <kcheng@cs.stanford.edu>
CC: java-interest@java.sun.com

This is a multi-part message in MIME format.

--------------59AA568D3347
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Kenneth Cheng wrote:
> 
> When I opened a file to a RandomAccessFile object, I receive the following
> I received an error when I tried to create a RandomAccessFile object.  Here is
> the error message I received:
>    **Security Exception: file.read:TESTING***
>    sun.applet.AppletSecurityException: security.file.read: TESTING
> 
> This is what I did to open a file:
>    RandomAccessFile rf = null;
>    try {rf = new RandomAccessFile("TESTING"), "rw")}
>       catch (Exception e) {System.out.println("error");}
> 
> It is a very simple fragment to run.  I had this segment together with my
> window interface program.  But when I run the same fragment alone in a new
> file, it works.
> Any idea?
> -Yet Another Security Problem :(

Applets have a class called SecurityManager which implements the security 
policy of the applet.
By default, netscape-like browsers have a very restrictive security policy.
Probably if you test your applet with appletviewer you won't have such
exception. 
There is one way you can aviod this security exception : Access Control List.
This allows you to define files ans directories where your applets can read
from and write to.
But I think you'd better read the document 
'Frequently Asked Questions - Applet Security'
http://java.sun.com/sfaq/

Hope this will help you :)

--------------59AA568D3347
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="mail-final"

--------------------------------------------------------------------------------
     _/ _/   _/ _/   _/ _/_/      JoanMa MAS RIBES
     _/ _/_/_// _/_/_// _/ _/
     _/ _/ _/_/ _/ _/_/ _/_/      Universite Catholique de Louvain
 _/  _/ _/   _/ _/   _/ _/ _/     Laboratoire de Telecommunications
  _/_/  _/   _/ _/   _/ _/  _/    Batiment Stevin
                                  2, Place du Levant
                                  B-1348 - Louvain La Neuve
                                  
  mailto:mas@tele.ucl.ac.be       Tel.: +32 - (0)10 - 478067
                                  Fax : +32 - (0)10 - 472089
                                  
           Security is when everything is settled.  
           When nothing can happen to you.  
           Security is the denial of life.   
--------------------------------------------------------------------------------

--------------59AA568D3347--

-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post