1 Reply Latest reply on Nov 9, 2010 8:04 AM by Wolfgang Knauf

    Java.util.logging.logger issue

    Karthick M Newbie

      Hi,

       

      I am new to Jboss EAP. Currently we are in process of migrating application into Jboss EAP 5.1.0. While application trying to print log message using java.util.logging.Logger info() method, it is throwing NULL pointer exception.

       

      Please help me to resolve this issue:

       

      Sample code from app:

       

      import java.util.logging.Logger;

      public class sampleServlet

      {

           Logger debug = Logger.getAnonymousLogger();

           debug.info("----------- start web stats ------------");

      }

       

       

      Error message:

       

      16:58:32,188 ERROR [[sampleServlet]] Servlet.service() for servlet sampleServlet threw exception
      java.lang.NullPointerException
              at org.apache.log4j.CategoryKey.<init>(CategoryKey.java:31)
              at org.apache.log4j.Hierarchy.getLogger(Hierarchy.java:261)
              at org.apache.log4j.Hierarchy.getLogger(Hierarchy.java:242)
              at org.apache.log4j.LogManager.getLogger(LogManager.java:188)
              at org.apache.log4j.Logger.getLogger(Logger.java:104)
              at org.jboss.logbridge.LogBridgeHandler.publish(LogBridgeHandler.java:71)
              at java.util.logging.Logger.log(Logger.java:458)
              at java.util.logging.Logger.doLog(Logger.java:480)
              at java.util.logging.Logger.log(Logger.java:503)
              at java.util.logging.Logger.info(Logger.java:1022)
              at com.sampleServlet(sampleServlet.java:114)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:183)
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:95)
              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
              at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
              at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
              at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
              at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:451)
              at java.lang.Thread.run(Thread.java:619)
      16:59:59,314 INFO  [ServerImpl] Runtime shutdown hook called, forceHalt: true
      16:59:59,314 INFO  [Http11Protocol] Pausing Coyote HTTP/1.1 on http-127.0.0.1-8080