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 B287510566 for ; Sat, 31 Aug 2013 18:57:52 +0000 (UTC) Received: (qmail 11522 invoked by uid 500); 31 Aug 2013 18:57:52 -0000 Delivered-To: apmail-logging-log4j-dev-archive@logging.apache.org Received: (qmail 11479 invoked by uid 500); 31 Aug 2013 18:57:52 -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 11466 invoked by uid 99); 31 Aug 2013 18:57:52 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 31 Aug 2013 18:57:52 +0000 Date: Sat, 31 Aug 2013 18:57:51 +0000 (UTC) From: "Ralph Goers (JIRA)" To: log4j-dev@logging.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (LOG4J2-359) Log4jServletContextListener does not work on Weblogic 12.1.1 (12c) with web-app version "2.5" 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-359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13755580#comment-13755580 ] Ralph Goers commented on LOG4J2-359: ------------------------------------ Further thoughts on this. I'd probably be more in favor of this if the initializer looked for a configuration being present and exited if it couldn't find one. But what if a user wants to create their own configuration factory? They can't override our initializer or replace it because it is embedded in the jar. Unless you provide extension points for users then this is just going to create a mess. > Log4jServletContextListener does not work on Weblogic 12.1.1 (12c) with web-app version "2.5" > --------------------------------------------------------------------------------------------- > > Key: LOG4J2-359 > URL: https://issues.apache.org/jira/browse/LOG4J2-359 > Project: Log4j 2 > Issue Type: Bug > Affects Versions: 2.0-beta8 > Reporter: Abhinav Shah > Assignee: Nick Williams > Fix For: 2.0-beta9 > > Attachments: LOG4J2-359.patch, Log4jServletContainerInitializer.java, Log4jServletContainerInitializerTest.java > > > I have Weblogic 12c running. My web-app is version "2.5". > Following is a snippet from my web.xml > {code:xml} > xmlns="http://java.sun.com/xml/ns/javaee" > xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" > id="WebApp_ID" version="2.5"> > pec-service > > log4jConfiguration > file:/C:/log4j/dev.log4j.xml > > > org.apache.logging.log4j.core.web.Log4jServletContextListener > > > log4jServletFilter > org.apache.logging.log4j.core.web.Log4jServletFilter > > > log4jServletFilter > /* > REQUEST > FORWARD > INCLUDE > ERROR > > > > {code} > However, on my server startup I am getting the following error - > {code} > java.lang.IllegalStateException: Context destroyed before it was initialized. > at org.apache.logging.log4j.core.web.Log4jServletContextListener.contextDestroyed(Log4jServletContextListener.java:51) > at weblogic.servlet.internal.EventsManager$FireContextListenerAction.run(EventsManager.java:583) > at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) > at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) > at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57) > Truncated. see log file for complete stacktrace > > > weblogic.application.ModuleException > at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1708) > at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:781) > at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:213) > at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:208) > at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:35) > Truncated. see log file for complete stacktrace > Caused By: java.lang.NullPointerException > at org.apache.logging.log4j.core.web.Log4jServletContainerInitializer.onStartup(Log4jServletContainerInitializer.java:44) > at weblogic.servlet.internal.WebAppServletContext.initContainerInitializer(WebAppServletContext.java:1271) > at weblogic.servlet.internal.WebAppServletContext.initContainerInitializers(WebAppServletContext.java:1229) > at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1726) > at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2740) > Truncated. see log file for complete stacktrace > > > > > weblogic.application.ModuleException > at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1708) > at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:781) > at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:213) > at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:208) > at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:35) > Truncated. see log file for complete stacktrace > Caused By: java.lang.NullPointerException > at org.apache.logging.log4j.core.web.Log4jServletContainerInitializer.onStartup(Log4jServletContainerInitializer.java:44) > at weblogic.servlet.internal.WebAppServletContext.initContainerInitializer(WebAppServletContext.java:1271) > at weblogic.servlet.internal.WebAppServletContext.initContainerInitializers(WebAppServletContext.java:1229) > at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1726) > at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2740) > Truncated. see log file for complete stacktrace > {code} > If I remove the listener & the filter, it works fine. > {color:red} > I did some research and found that even though the web-app is version "2.5", the {code}Log4jServletContainerInitializer{code} is getting invoked. > {color} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-dev-help@logging.apache.org