Well, the references to *nullWEB-INF* seems pretty suspicious. I would check the vAlue of prefix on the class Log4jInit.
2012/2/8 siv99 <[email protected]> > > Hi, > I am trying to use log4j in my application and i am getting following > error. Thanks a lot for the help in advance. > > > log4j:ERROR Could not parse file [nullWEB-INF/logging/log4j.xml]. > java.io.FileNotFoundException: > /app/ENP/user_projects/domains/Domain2/nullWEB-INF/logging/log4j.xml (No > such file or directory) > at java.io.FileInputStream.open(Native Method) > at java.io.FileInputStream.<init>(FileInputStream.java:106) > at java.io.FileInputStream.<init>(FileInputStream.java:66) > at > > sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70) > at > > sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161) > at java.net.URL.openStream(URL.java:1010) > at oracle.xml.parser.v2.XMLReader.openURL(XMLReader.java:2650) > at oracle.xml.parser.v2.XMLReader.pushXMLReader(XMLReader.java:253) > at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:222) > at > oracle.xml.jaxp.JXDocumentBuilder.parse(JXDocumentBuilder.java:155) > at > > weblogic.xml.jaxp.RegistryDocumentBuilder.parse(RegistryDocumentBuilder.java:163) > at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:208) > at > org.apache.log4j.xml.DOMConfigurator$1.parse(DOMConfigurator.java:749) > at > org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:866) > at > org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:755) > at > org.apache.log4j.xml.DOMConfigurator.configure(DOMConfigurator.java:891) > at gov.cms.esrd.qip.utilities.Log4jInit.init(Log4jInit.java:16) > at javax.servlet.GenericServlet.init(GenericServlet.java:241) > at > > weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:283) > at > > weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) > at > weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) > at > > weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64) > at > > weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58) > at > > weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:48) > at > > weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:539) > at > > weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1985) > at > > weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1959) > at > > weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1878) > at > > weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3153) > at > > weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1508) > > > > Here is my web.xml code > > <servlet> > <servlet-name>log4j-init</servlet-name> > > > > <servlet-class>gov.cms.esrd.qip.utilities.Log4jInit</servlet-class> > > <init-param> > <param-name>log4j-init-file</param-name> > > <param-value>WEB-INF/logging/log4j.xml</param-value> > </init-param> > > <load-on-startup>1</load-on-startup> > </servlet> > > > > > configuration file (Log4jInit)code > > package gov.cms.esrd.qip.utilities; > > > > import javax.servlet.http.HttpServlet; > > import javax.servlet.http.HttpServletRequest; > > import javax.servlet.http.HttpServletResponse; > > import org.apache.log4j.xml.DOMConfigurator; > > > > public class Log4jInit extends HttpServlet { > > > public void init() { > > String prefix = getServletContext().getRealPath("/"); > > String file = getInitParameter("log4j-init-file"); > > // if the log4j-init-file is not set, then no point in trying > > if (file != null) { > > DOMConfigurator.configure(prefix + file); > } > > } > > > public void doGet(HttpServletRequest req, > HttpServletResponse res) { > > } > > } > > > > Log4j.xml file > > <?xml version="1.0" encoding="UTF-8" ?> > > <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> > > <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> > <appender name="console" class="org.apache.log4j.ConsoleAppender"> > > <param name="Target" value="System.out"/> > > <layout class="org.apache.log4j.PatternLayout"> > <param name="ConversionPattern" value="%-5p %c{1} - %m%n"/> > > </layout> > </appender> > <appender name="WeblogicAppender" > class="gov.cms.esrd.qip.logging.WeblogicAppender"> > > <layout class="org.apache.log4j.PatternLayout"></layout> > </appender> > > <appender name="RD" > class="org.apache.log4j.DailyRollingFileAppender"> > <param name="file" value="logs/RD.BPM.log" /> > > <param name="DatePattern" value="'.'yyy-MM-dd" /> > <layout class="org.apache.log4j.PatternLayout"> > > <!-- Print the date in ISO 8601 format --> > > <param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n"/> > > </layout> > > </appender> > <root> > > <priority value="debug"/> > <appender-ref ref="RD"/> > </root> > > </log4j:configuration> > > > Thanks. > -- > View this message in context: > http://old.nabble.com/log4j%3AERROR-Could-not-parse-file-tp33289799p33289799.html > Sent from the Log4j - Users mailing list archive at Nabble.com. >
