Dear all,

I am new in Java and sorry for asking this applet related question in this
forum.

I have created an applet to write something to a text file and it works
fine with appletviewer. I have created a policy file for it and it works
fine.
When  I try this applet within a browser(netscape 4.61) it gives an error
message like
-----------------------------------------------------------------------------------------------
java.security.AccessControlException: access denied
(java.lang.RuntimePermission modifyThreadGroup)

     at java.security.AccessControlContext.checkPermission(Unknown Source)

     at java.security.AccessController.checkPermission(Unknown Source)

     at java.lang.SecurityManager.checkPermission(Unknown Source)

     at sun.applet.AppletSecurity.checkAccess(Unknown Source)

     at java.lang.ThreadGroup.checkAccess(Unknown Source)

     at java.lang.Thread.init(Unknown Source)

     at java.lang.Thread.<init>(Unknown Source)

     at javax.swing.TimerQueue.start(Unknown Source)

     at javax.swing.TimerQueue.<init>(Unknown Source)

     at javax.swing.TimerQueue.sharedInstance(Unknown Source)

     at javax.swing.JApplet.<init>(Unknown Source)

     at FileIOAppl.<init>(FileIOAppl.java:8)

     at java.lang.Class.newInstance0(Native Method)

     at java.lang.Class.newInstance(Unknown Source)

     at sun.applet.AppletPanel.createApplet(Unknown Source)

     at sun.plugin.AppletViewer.createApplet(Unknown Source)

     at sun.applet.AppletPanel.runLoader(Unknown Source)

     at sun.applet.AppletPanel.run(Unknown Source)

     at java.lang.Thread.run(Unknown Source)
---------------------------------------------------------------------------------------------------------

my policy file contains
----------------------------------------------------------------------------------------------------------
/* AUTOMATICALLY GENERATED ON Tue Dec 19 10:57:16 GMT+01:00 2000*/
/* DO NOT EDIT */

grant {
  permission java.io.FilePermission "${user.home}/text.txt", "read, write,
delete, execute";
};
-------------------------------------------------------------------------------------------------------------

I am using JDK 1.3.
My basic question is where do  we keep policy file  for applet while
calling from browser?
What shuold be the name of this file?

Thanks in advance
martin



Reply via email to