Return-Path: X-Original-To: apmail-logging-log4j-dev-archive@www.apache.org Delivered-To: apmail-logging-log4j-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E91891872A for ; Mon, 19 Oct 2015 14:29:05 +0000 (UTC) Received: (qmail 67893 invoked by uid 500); 19 Oct 2015 14:29:05 -0000 Delivered-To: apmail-logging-log4j-dev-archive@logging.apache.org Received: (qmail 67803 invoked by uid 500); 19 Oct 2015 14:29:05 -0000 Mailing-List: contact log4j-dev-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Developers List" Reply-To: "Log4J Developers List" Delivered-To: mailing list log4j-dev@logging.apache.org Received: (qmail 67562 invoked by uid 99); 19 Oct 2015 14:29:05 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 19 Oct 2015 14:29:05 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 526302C1F65 for ; Mon, 19 Oct 2015 14:29:05 +0000 (UTC) Date: Mon, 19 Oct 2015 14:29:05 +0000 (UTC) From: "Remko Popma (JIRA)" To: log4j-dev@logging.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (LOG4J2-493) Problem with AsyncLogger when web app is deployed/undeployed multiple times MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LOG4J2-493?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Remko Popma updated LOG4J2-493: ------------------------------- Fix Version/s: 2.5 > Problem with AsyncLogger when web app is deployed/undeployed multiple times > --------------------------------------------------------------------------- > > Key: LOG4J2-493 > URL: https://issues.apache.org/jira/browse/LOG4J2-493 > Project: Log4j 2 > Issue Type: Bug > Components: Core > Affects Versions: 2.0-beta9, 2.0-rc1 > Environment: tomcat 7.0.42 > Reporter: Kireet Reddy > Assignee: Remko Popma > Labels: Async > Fix For: 2.5 > > > When redeploying my application in tomcat multiple times, I get an exception: > {code} > Exception in thread "Thread-29" java.lang.NullPointerException > at org.apache.logging.log4j.core.async.AsyncLogger.stop(AsyncLogger.java:249) > at org.apache.logging.log4j.core.async.AsyncLoggerContext.stop(AsyncLoggerContext.java:56) > at org.apache.logging.log4j.core.LoggerContext$ShutdownThread.run(LoggerContext.java:437) > {code} > This seems to be due to the fact that some initialization code happens in the class initializer but is undone in the stop() method which is called during webapp undeployment. This causes issues because in this case the log4j jar is loaded by the shared classloader ($catalina.home/lib) rather than the webapp classloader. This means the AsyncLogger class is not re-created during webapp deployment. > I am using this structure because I have many 3rd party libraries and want to keep redeployments lightweight. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-dev-help@logging.apache.org