Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Signing applet on the MAC problems

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Well I've finally go my signed applet to work on Windows Internet Explorer using CAB file and I'm trying to get it to work on MAC Internet Explorer:
I followed the instructions at the following site to create a self-signed applet for testing:
http://developer.apple.com/technotes/tn/tn1175.html
However I am getting a Apple security exception when trying to write to a file output:
/29/2002 @ 8:27:46
here
throwable exception
file writing test
trying to write to file: output.txt
Exception occurred during event dispatching:
com.apple.mrj.JManager.JMAppletSecurityExc: security.checkwrite: output.txt, /Macintosh HD/Applications (Mac OS 9)/Internet Explorer 5 Folder/output.txt
at com.apple.mrj.JManager.JMAppletSecurityOld.checkWrite(JMAppletSecurityOld.java)
at java.io.FileOutputStream.<init>(FileOutputStream.java)
at java.io.FileWriter.<init>(FileWriter.java)
at testapp.actionPerformed(testapp.java:121)
at java.awt.Button.processActionEvent(Button.java)
at java.awt.Button.processEvent(Button.java)
at java.awt.Component.dispatchEventImpl(Component.java)
at java.awt.Component.dispatchEvent(Component.java)
at java.awt.EventDispatchThread.run(EventDispatchThread.java

Here is the code I am using:
public void actionPerformed(ActionEvent e) {

if (e.getSource()==saveM) {
try {

if (Class.forName("com.ms.security.PolicyEngine")!=null) {
System.out.println("FOUND com.ms.security.PolicyEngine");
com.ms.security.PolicyEngine.assertPermission(com.ms.security.PermissionID.FILEIO);
System.out.println("got file io permission");
} else {
System.out.println("DID NOT FIND com.ms.security.PolicyEngine");
}
} catch (Throwable t) {
System.out.println("throwable exception");
}
System.out.println("file writing test");
try {
System.out.println("trying to write to file: output.txt");
FileWriter f = new FileWriter("output.txt");
f.write("suceed");
f.close();
System.out.println("SUCEEDED in writing to file");
} catch (IOException a) {
System.out.println("IOEXCEPTION while trying to write to file");
}
} else {
try {
if (Class.forName("com.ms.security.PolicyEngine")
!= null) {
System.out.println("hello");
com.ms.security.PolicyEngine.assertPermission(com.ms.security.PermissionID.PRINTING);
System.out.println("got printing permission");
com.ms.security.PolicyEngine.assertPermission(com.ms.security.PermissionID.FILEIO);
System.out.println("got file io permission");

} else {
System.out.println("goodbye");
}
} catch (Throwable t) {
System.out.println("here");
}

}

If you have any insight as to what I'm doing wrong, your help would be greatly appreciated.
I am running on a MAC OS 9, IE 5.0, and I installed MRJ 2.2.5.
Thanks,
Naomi
 
    Bookmark Topic Watch Topic
  • New Topic