problem faced while writing into logs using applet

Discussions

Web tier: servlets, JSP, Web frameworks: problem faced while writing into logs using applet

  1. problem faced while writing into logs using applet (1 messages)

    Hi, I am facing a problem when i use logs(log4j) in the application. With the applet i am accessing the servlet which has logs. when i try to open the applet i am getting this error. java.lang.ExceptionInInitializerError at elsevier.xpharm.toc.admin.SaveManager.(Unknown Source) at elsevier.xpharm.toc.admin.TocAdminApplet.init(Unknown Source) at sun.applet.AppletPanel.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.security.AccessControlException: access denied (java.io.FilePermission xpharm_log.txt write) at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at java.lang.SecurityManager.checkWrite(Unknown Source) at java.io.FileOutputStream.(Unknown Source) at java.io.FileOutputStream.(Unknown Source) at java.io.FileWriter.(Unknown Source) at org.apache.log4j.FileAppender.setFile(FileAppender.java:284) at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:239) at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:247) at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java: 123) at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java: 87) at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator. java:637) at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator. java:595) at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfi gurator.java:502) at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.ja va:410) at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.ja va:436) at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConvert er.java:455) at org.apache.log4j.Category.(Category.java:146) ... 4 more can any one help me out from this issue Regards, G.R.Reddy
  2. Applets (Unsigned) run in a security sandbox at the client. The sandbox forbids access to the file system (amongst several restrictions). You cannot therefore log to a file. You either have to stream your log to System.out (where it will appear in the java plugin console output), or sign your applet using a security cerificate, giving it IO access. Regards N