logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Remko Popma (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-1331) Web apps fail to start
Date Fri, 25 Mar 2016 10:29:25 GMT

    [ https://issues.apache.org/jira/browse/LOG4J2-1331?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15211679#comment-15211679
] 

Remko Popma commented on LOG4J2-1331:
-------------------------------------

where are the log4j jars located? All in the tomcat container lib folder, all in your web
ap's WEB-INF/lib, or both? Also, where is your log4j2.xml config file located?

Since the MainMapLookup class was added in log4j-2.4, I suspect that Tomcat still has a log4j-core-2.3
jar lying around somewhere...

> Web apps fail to start
> ----------------------
>
>                 Key: LOG4J2-1331
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1331
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Web/Servlet
>    Affects Versions: 2.4.1, 2.5
>         Environment: Windows Server, Java 7, Tomcat 7, JSF 1.2
>            Reporter: Nicola Isotta
>
> After upgrading from Log4j 2.3, my webapps fail to start after a Tomcat restart. Actually,
the first one starts correctly (even in multiple versions), while the others' startup fails.
> These are the causes:
> {quote}
> SEVERE: Error configuring application listener of class it.mycompany.filters.MyFilter
> java.lang.NoClassDefFoundError: Could not initialize class org.apache.logging.log4j.core.lookup.MainMapLookup
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
> 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
> 	at java.lang.reflect.Constructor.newInstance(Unknown Source)
> 	at org.apache.logging.log4j.core.util.ReflectionUtil.instantiate(ReflectionUtil.java:185)
> 	at org.apache.logging.log4j.core.lookup.Interpolator.<init>(Interpolator.java:65)
> 	at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:346)
> 	at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:161)
> 	at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:361)
> 	at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:426)
> 	at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:442)
> 	at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:138)
> 	at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:147)
> 	at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:41)
> 	at org.apache.logging.log4j.LogManager.getContext(LogManager.java:175)
> 	at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:426)
> 	at it.emmeduei.drijsf.filtri.SessionListener.<clinit>(SessionListener.java:21)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
> 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
> 	at java.lang.reflect.Constructor.newInstance(Unknown Source)
> 	at java.lang.Class.newInstance0(Unknown Source)
> 	at java.lang.Class.newInstance(Unknown Source)
> 	at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:116)
> 	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4932)
> 	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5524)
> 	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
> 	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
> 	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
> 	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
> 	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1081)
> 	at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1877)
> 	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
> 	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
> 	at java.util.concurrent.FutureTask.run(Unknown Source)
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> 	at java.lang.Thread.run(Unknown Source){quote}
> and, similar:
> {quote}SEVERE: Exception sending context initialized event to listener instance of class
org.apache.logging.log4j.web.Log4jServletContextListener
> java.lang.NoClassDefFoundError: Could not initialize class org.apache.logging.log4j.core.lookup.MainMapLookup{quote}
> {quote}SEVERE: Exception sending context destroyed event to listener instance of class
org.apache.logging.log4j.web.Log4jServletContextListener
> java.lang.IllegalStateException: Cannot stop this Log4jWebInitializer because it has
not started.{quote}
> This did not happen with 2.3. The only thing I did was changing the jars, problem occurs
with both 2.4.1 e 2.5.
> EDIT: even if the "first" web app starts, logging doesn't.



--
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


Mime
View raw message