6 Replies Latest reply: Aug 25, 2008 12:45 AM by 807589 RSS

    log4j:ERROR setFile(null,true) call failed  on solaris

    807589
      Here I have a question about log4j on unix.

      In my application, I create a log file daily accrding to log4j RollingFileAppender.
      sometimes this log file's user and group is same with user and group which executing this application.
      However occasionally this log file's user and group is different from login user, this will cause the following exception.
      I dont know why sometime its user and group are different.


      log4j:ERROR setFile(null,true) call failed.
      java.io.FileNotFoundException: /opt/nortel/logs/mjm/traces/20080822.log (Permission denied)
           at java.io.FileOutputStream.openAppend(Native Method)
           at java.io.FileOutputStream.<init>(FileOutputStream.java:177)
           at java.io.FileOutputStream.<init>(FileOutputStream.java:102)
           at org.apache.log4j.FileAppender.setFile(FileAppender.java:272)
           at org.apache.log4j.RollingFileAppender.setFile(RollingFileAppender.java:156)
           at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:151)
           at com.nortel.oam.mjm.logging.DatestampedRollingFileAppender.activateOptions(DatestampedRollingFileAppender.java:76)
           at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:247)
           at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:210)
           at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:140)
           at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:153)
           at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:415)
           at org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:384)
           at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:783)
           at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:666)
           at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:616)
           at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:584)
           at com.nortel.oam.mjm.logging.osgi.impl.Log4jXMLWatchdog.doOnChange(Log4jDOMConfigurator.java:33)
           at org.apache.log4j.helpers.FileWatchdog.checkAndConfigure(FileWatchdog.java:80)
           at org.apache.log4j.helpers.FileWatchdog.<init>(FileWatchdog.java:49)
           at com.nortel.oam.mjm.logging.osgi.impl.Log4jXMLWatchdog.<init>(Log4jDOMConfigurator.java:27)
           at com.nortel.oam.mjm.logging.osgi.impl.Log4jDOMConfigurator.configureAndWatch(Log4jDOMConfigurator.java:17)
           at com.nortel.oam.mjm.logging.osgi.impl.Log4jDOMConfigurator.configureAndWatch(Log4jDOMConfigurator.java:12)
           at com.nortel.oam.mjm.logging.osgi.impl.Activator.start(Activator.java:34)
           at org.knopflerfish.framework.BundleImpl.start0(BundleImpl.java:373)
           at org.knopflerfish.framework.PermissionOps.callStart0(PermissionOps.java:198)
           at org.knopflerfish.framework.BundleImpl.start(BundleImpl.java:320)
           at org.knopflerfish.framework.Framework.startBundle(Framework.java:503)
           at org.knopflerfish.framework.Main.handleArgs(Main.java:312)
           at org.knopflerfish.framework.Main.main(Main.java:193)