1 Reply Latest reply on Oct 24, 2006 7:21 AM by jaikiran pai

    problem configuring log4j in JBoss

    Inder Jeet Singh Newbie

      Hi
      I am new to Jboss. I was using iplanet prior to this. My web application is using log4j for logging. But how the log4j be configured with Jboss, I am not able to find out. I have tried by putting log4j.properties file in the WEB-INF/classes folder and the log4j jar file in WEB-INF/lib folder. But on running my web application it is not generating any log files, as configured by me in log4j.properties file. Instead it is showing exception in the "server.log" file.
      The exception is
      2006-10-24 13:10:29,354 INFO [STDOUT] log4j:ERROR A "org.jboss.logging.util.OnlyOnceErrorHandler" object is not assignable to a "org.apache.log4j.spi.ErrorHandler" variable.
      2006-10-24 13:10:29,354 INFO [STDOUT] log4j:ERROR The class "org.apache.log4j.spi.ErrorHandler" was loaded by
      2006-10-24 13:10:29,354 INFO [STDOUT] log4j:ERROR [WebappClassLoader
      delegate: false
      repositories:
      /WEB-INF/classes/
      ----------> Parent Classloader:
      java.net.FactoryURLClassLoader@183608e
      ] whereas object of type
      2006-10-24 13:10:29,354 INFO [STDOUT] log4j:ERROR "org.jboss.logging.util.OnlyOnceErrorHandler" was loaded by [org.jboss.system.server.NoAnnotationURLClassLoader@19189e1].
      2006-10-24 13:10:29,463 INFO [STDOUT] log4j:ERROR Could not create an Appender. Reported error follows.
      2006-10-24 13:10:29,463 INFO [STDOUT] java.lang.ClassCastException
      2006-10-24 13:10:29,463 INFO [STDOUT] at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:175)
      2006-10-24 13:10:29,463 INFO [STDOUT] at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:150)
      2006-10-24 13:10:29,463 INFO [STDOUT] at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:163)
      2006-10-24 13:10:29,463 INFO [STDOUT] at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:425)
      2006-10-24 13:10:29,463 INFO [STDOUT] at org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:394)
      2006-10-24 13:10:29,463 INFO [STDOUT] at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:829)
      2006-10-24 13:10:29,463 INFO [STDOUT] at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:712)
      2006-10-24 13:10:29,463 INFO [STDOUT] at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:618)
      2006-10-24 13:10:29,463 INFO [STDOUT] at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:468)
      2006-10-24 13:10:29,463 INFO [STDOUT] at org.apache.log4j.LogManager.(LogManager.java:122)
      2006-10-24 13:10:29,463 INFO [STDOUT] at org.apache.log4j.Logger.getLogger(Logger.java:104)
      2006-10-24 13:10:29,463 INFO [STDOUT] at com.siemens.ppas.crm.model.LoadWorkForce.(LoadWorkForce.java:35)
      2006-10-24 13:10:29,463 INFO [STDOUT] at com.siemens.ppas.crm.servlet.CompManageServlet.doPost(CompManageServlet.java:87)
      2006-10-24 13:10:29,463 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      2006-10-24 13:10:29,463 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      2006-10-24 13:10:29,463 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      2006-10-24 13:10:29,463 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      2006-10-24 13:10:29,479 INFO [STDOUT] at java.lang.Thread.run(Thread.java:534)
      2006-10-24 13:10:29,479 INFO [STDOUT] log4j:ERROR Could not parse url [file:/D:/jboss-4.0.3SP1/server/default/conf/log4j.xml].
      2006-10-24 13:10:29,479 INFO [STDOUT] java.lang.NullPointerException
      2006-10-24 13:10:29,479 INFO [STDOUT] at java.util.Hashtable.put(Hashtable.java:393)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:151)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:163)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:425)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.log4j.xml.DOMConfigurator.parseRoot(DOMConfigurator.java:394)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:829)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:712)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:618)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:468)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.log4j.LogManager.(LogManager.java:122)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.log4j.Logger.getLogger(Logger.java:104)
      2006-10-24 13:10:29,479 INFO [STDOUT] at com.siemens.ppas.crm.model.LoadWorkForce.(LoadWorkForce.java:35)
      2006-10-24 13:10:29,479 INFO [STDOUT] at com.siemens.ppas.crm.servlet.CompManageServlet.doPost(CompManageServlet.java:87)
      2006-10-24 13:10:29,479 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      2006-10-24 13:10:29,479 INFO [STDOUT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:159)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
      2006-10-24 13:10:29,479 INFO [STDOUT] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      2006-10-24 13:10:29,495 INFO [STDOUT] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
      2006-10-24 13:10:29,495 INFO [STDOUT] at java.lang.Thread.run(Thread.java:534)