[JIRA] Created: (LBCLASSIC-74) NullPointerException in Logger after container restart

NullPointerException in Logger after container restart ------------------------------------------------------ Key: LBCLASSIC-74 URL: http://jira.qos.ch/browse/LBCLASSIC-74 Project: logback-classic Issue Type: Bug Affects Versions: 0.9.9 Environment: Eclipse 3.4, Java 5, Tomcat 5.5.26, plain JSP (no servlet) Reporter: Manel Clos Assignee: Logback dev list Hi, loggerContext in the Logger class is null after container restart. This will produce a NPE when trying to further use logback. java.lang.NullPointerException at ch.qos.logback.classic.Logger.callTurboFilters(Logger.java:775) at ch.qos.logback.classic.Logger.isDebugEnabled(Logger.java:630) at ch.qos.logback.classic.Logger.isDebugEnabled(Logger.java:613) at test.LogbackTest.testLogger(LogbackTest.java:15) -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCLASSIC-74?page=com.atlassian.jira.plugin.system... ] Manel Clos updated LBCLASSIC-74: -------------------------------- Attachment: minimalwebapp.zip Testcase showing the problem. maven webapp archetype, index.jsp calling the testcase. Run the webapp, see the "Hello World" message. Restart Tomcat and try to access the webapp again. A NPE should happen. My *real* application started failing after migration from log4j to logback. This testcase is just a simplification.
NullPointerException in Logger after container restart ------------------------------------------------------
Key: LBCLASSIC-74 URL: http://jira.qos.ch/browse/LBCLASSIC-74 Project: logback-classic Issue Type: Bug Affects Versions: 0.9.9 Environment: Eclipse 3.4, Java 5, Tomcat 5.5.26, plain JSP (no servlet) Reporter: Manel Clos Assignee: Logback dev list Attachments: minimalwebapp.zip
Hi, loggerContext in the Logger class is null after container restart. This will produce a NPE when trying to further use logback. java.lang.NullPointerException at ch.qos.logback.classic.Logger.callTurboFilters(Logger.java:775) at ch.qos.logback.classic.Logger.isDebugEnabled(Logger.java:630) at ch.qos.logback.classic.Logger.isDebugEnabled(Logger.java:613) at test.LogbackTest.testLogger(LogbackTest.java:15)
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCLASSIC-74?page=com.atlassian.jira.plugin.system... ] Manel Clos commented on LBCLASSIC-74: ------------------------------------- Hi, Though I switched from Log4j, in the code I'm really using commons-logging objects. I modified the example to use commons-logging and it works with no problem. import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; //import org.slf4j.Logger; //import org.slf4j.LoggerFactory; ... // private final Logger logger = LoggerFactory.getLogger(LogbackTest.class); private final Log logger = LogFactory.getLog(LogbackTest.class);
NullPointerException in Logger after container restart ------------------------------------------------------
Key: LBCLASSIC-74 URL: http://jira.qos.ch/browse/LBCLASSIC-74 Project: logback-classic Issue Type: Bug Affects Versions: 0.9.9 Environment: Eclipse 3.4, Java 5, Tomcat 5.5.26, plain JSP (no servlet) Reporter: Manel Clos Assignee: Logback dev list Attachments: minimalwebapp.zip
Hi, loggerContext in the Logger class is null after container restart. This will produce a NPE when trying to further use logback. java.lang.NullPointerException at ch.qos.logback.classic.Logger.callTurboFilters(Logger.java:775) at ch.qos.logback.classic.Logger.isDebugEnabled(Logger.java:630) at ch.qos.logback.classic.Logger.isDebugEnabled(Logger.java:613) at test.LogbackTest.testLogger(LogbackTest.java:15)
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCLASSIC-74?page=com.atlassian.jira.plugin.system... ] Ceki Gulcu updated LBCLASSIC-74: -------------------------------- Fix Version/s: 0.9.12 Assignee: Ceki Gulcu (was: Logback dev list) Priority: Critical (was: Major) I could reproduce the issue.
NullPointerException in Logger after container restart ------------------------------------------------------
Key: LBCLASSIC-74 URL: http://jira.qos.ch/browse/LBCLASSIC-74 Project: logback-classic Issue Type: Bug Affects Versions: 0.9.9 Environment: Eclipse 3.4, Java 5, Tomcat 5.5.26, plain JSP (no servlet) Reporter: Manel Clos Assignee: Ceki Gulcu Priority: Critical Fix For: 0.9.12
Attachments: minimalwebapp.zip
Hi, loggerContext in the Logger class is null after container restart. This will produce a NPE when trying to further use logback. java.lang.NullPointerException at ch.qos.logback.classic.Logger.callTurboFilters(Logger.java:775) at ch.qos.logback.classic.Logger.isDebugEnabled(Logger.java:630) at ch.qos.logback.classic.Logger.isDebugEnabled(Logger.java:613) at test.LogbackTest.testLogger(LogbackTest.java:15)
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCLASSIC-74?page=com.atlassian.jira.plugin.system... ] Ceki Gulcu commented on LBCLASSIC-74: ------------------------------------- I can reproduce the following exception, under Tomcat 5.0.26 and Tomcat 6.0.18. java.lang.NullPointerException ch.qos.logback.classic.Logger.callTurboFilters(Logger.java:791) ch.qos.logback.classic.Logger.isDebugEnabled(Logger.java:646) ch.qos.logback.classic.Logger.isDebugEnabled(Logger.java:629) test.LogbackTest.testLogger(LogbackTest.java:15) org.apache.jsp.index_jsp._jspService(index_jsp.java:60) After a little analysis, I think the problem is due to the fact that Tomcat saves the session, and when the application restarts, it deserializes the LoggerTest object which contains a field referencing a logger. However, this field does not contain a valid reference to a LoggerContext. Problem is solved in revision 1897.
NullPointerException in Logger after container restart ------------------------------------------------------
Key: LBCLASSIC-74 URL: http://jira.qos.ch/browse/LBCLASSIC-74 Project: logback-classic Issue Type: Bug Affects Versions: 0.9.9 Environment: Eclipse 3.4, Java 5, Tomcat 5.5.26, plain JSP (no servlet) Reporter: Manel Clos Assignee: Ceki Gulcu Priority: Critical Fix For: 0.9.12
Attachments: minimalwebapp.zip
Hi, loggerContext in the Logger class is null after container restart. This will produce a NPE when trying to further use logback. java.lang.NullPointerException at ch.qos.logback.classic.Logger.callTurboFilters(Logger.java:775) at ch.qos.logback.classic.Logger.isDebugEnabled(Logger.java:630) at ch.qos.logback.classic.Logger.isDebugEnabled(Logger.java:613) at test.LogbackTest.testLogger(LogbackTest.java:15)
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira

[ http://jira.qos.ch/browse/LBCLASSIC-74?page=com.atlassian.jira.plugin.system... ] Ceki Gulcu resolved LBCLASSIC-74. --------------------------------- Resolution: Fixed solved with revision #1897
NullPointerException in Logger after container restart ------------------------------------------------------
Key: LBCLASSIC-74 URL: http://jira.qos.ch/browse/LBCLASSIC-74 Project: logback-classic Issue Type: Bug Affects Versions: 0.9.9 Environment: Eclipse 3.4, Java 5, Tomcat 5.5.26, plain JSP (no servlet) Reporter: Manel Clos Assignee: Ceki Gulcu Priority: Critical Fix For: 0.9.12
Attachments: minimalwebapp.zip
Hi, loggerContext in the Logger class is null after container restart. This will produce a NPE when trying to further use logback. java.lang.NullPointerException at ch.qos.logback.classic.Logger.callTurboFilters(Logger.java:775) at ch.qos.logback.classic.Logger.isDebugEnabled(Logger.java:630) at ch.qos.logback.classic.Logger.isDebugEnabled(Logger.java:613) at test.LogbackTest.testLogger(LogbackTest.java:15)
-- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira



participants (3)
-
Ceki Gulcu (JIRA)
-
Guido Schweizer (JIRA)
-
Manel Clos (JIRA)