Please help, **** policy files
Hi,
I need to load a signed applet with applet viewer. I have done the following
linked my policy file(which grants all permissions) to the .java.security file.
Following are excerpts from files pasted:
java.security
policy.url.1=file:${java.home}/lib/security/java.policy
policy.url.2="file:/C:/Documents and Settings/Administrator/Desktop/Spring 2004/CS 441/Project Part A/web/abhi.policy"
abhi.policy
/* AUTOMATICALLY GENERATED ON Thu Mar 11 08:06:09 CST 2004*/
/* DO NOT EDIT */
keystore "tiredstore.ks", "ks";
grant codeBase "file:/C:/Documents and Settings/Administrator/Desktop/Spring 2004/CS 441/Project Part A/web/graph.html" {
permission java.security.AllPermission;
};
graph.html
<HTML>
<BODY>
<APPLET CODE=abhi/MyView.class ARCHIVE="spooplet.jar" WIDTH=800 HEIGHT=800>
</APPLET>
</BODY>
</HTML>
I have been trying to figure this out, but to no avail, How do I even kow if the policy files are being used? apprently they are not because following is the error I get
Command run to invoke appletviewer
"C:\j2sdk1.4.2_03\bin\appletviewer" "file:/C:/Documents and Settings/Administrator/Desktop/Spring 2004/CS 441/Project Part A/web/graph.html"
Error from applet
java.security.AccessControlException: access denied (java.util.PropertyPermissio
n user.dir read)
at java.security.AccessControlContext.checkPermission(AccessControlConte
xt.java:269)
at java.security.AccessController.checkPermission(AccessController.java:
401)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:524)
at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:12
76)
at java.lang.System.getProperty(System.java:573)
at java.io.Win32FileSystem.getUserPath(Win32FileSystem.java:272)
at java.io.Win32FileSystem.resolve(Win32FileSystem.java:288)
at java.io.File.getAbsolutePath(File.java:459)
at sun.awt.shell.Win32ShellFolder2.<init>(Win32ShellFolder2.java:191)
at sun.awt.shell.Win32ShellFolder2.listFiles(Win32ShellFolder2.java:504)
at sun.awt.shell.ShellFolder.listFiles(ShellFolder.java:115)
at sun.awt.shell.Win32ShellFolderManager2.get(Win32ShellFolderManager2.j
ava:189)
at sun.awt.shell.ShellFolder.get(ShellFolder.java:245)
at javax.swing.plaf.metal.MetalFileChooserUI.installComponents(MetalFile
ChooserUI.java:311)
at javax.swing.plaf.basic.BasicFileChooserUI.installUI(BasicFileChooserU
I.java:130)
at javax.swing.plaf.metal.MetalFileChooserUI.installUI(MetalFileChooserU
I.java:152)
at javax.swing.JComponent.setUI(JComponent.java:449)
at javax.swing.JFileChooser.updateUI(JFileChooser.java:1701)
at javax.swing.JFileChooser.setup(JFileChooser.java:345)
at javax.swing.JFileChooser.<init>(JFileChooser.java:320)
at javax.swing.JFileChooser.<init>(JFileChooser.java:273)
at abhi.MyView.<init>(MyView.java:56)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:308)
at java.lang.Class.newInstance(Class.java:261)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:617)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:546)
at sun.applet.AppletPanel.run(AppletPanel.java:298)
at java.lang.Thread.run(Thread.java:534)

