[3285] in java-interest

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

Getting Security Exception

daemon@ATHENA.MIT.EDU (David Strauss)
Mon Nov 6 11:50:59 1995

To: java-interest@java.sun.com
From: dstrauss@panix.com (David Strauss)
Date: Mon, 06 Nov 95 06:57:54 

I am attempting to run the Fractal demo applet that comes with
the beta JDK (I'm running Windows 95) by loading an HTML file
into the Applet Viewer from a different directory than /java/demo/Fractal,
where the applet's classes are stored.  I am modifying the example1.html
that comes with it by adding the codebase attribute as follows:

<applet codebase="file:/c:/Java/demo/Fractal"
        code="CLSFractal.class" width=500 height=120>


I save this mod in a different directory, load it into the Applet
Viewer and get the following output:

[no properties loaded, using defaults]
Thread-1 find class CLSFractal
Opening stream to: file:/c:/Java/demo/Fractal/CLSFractal.class to get 
CLSFractal
status: applet loaded
Thread-1 find class ContextLSystem
Opening stream to: file:/c:/Java/demo/Fractal/ContextLSystem.class to get 
ContextLSystem
*** Security Exception: file.read:\c:\Java\demo\Fractal\ContextLSystem.class 
***
sun.applet.AppletSecurityException: security.file.read: 
\c:\Java\demo\Fractal\ContextLSystem.class
        at sun.applet.AppletSecurity.checkRead(AppletSecurity.java:226)
        at java.io.FileInputStream.<init>(FileInputStream.java:49)
        at 
sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:67)
        at 
sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.j
ava:74)
        at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:65)
        at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:160)
        at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:122)
        at java.awt.Component.resize(Component.java:451)
        at sun.applet.AppletPanel.run(AppletPanel.java:275)
        at java.lang.Thread.run(Thread.java:286)


Thus, it seems to have no problem finding and loading the CLSFractal
class but chokes on ContextLSystem, which is in the same directory.
Incidentally, loading the original example1.html from the Fractal
directory works fine.

What do I need to know about security restrictions that I don't? 
------------------------------------------------
David Strauss
E-mail: dstrauss@popserver.panix.com 
              dstrauss@lehman.com 
-------------------------------------------------

-
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