title: SLF4J: java.lang.IllegalStateException: org.slf4j.LoggerFactory could not be successfully initialized
body: <p>I have the following maven dependency in my pom file:</p>
  
  <pre><code>&lt;!-- depends on slf4j-api, log4j --&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
      &lt;artifactId&gt;slf4j-log4j12&lt;/artifactId&gt;
      &lt;version&gt;1.6.4&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>When I deploy the project into tomcat, I am getting the error message:</p>
  
  <pre><code>SEVERE: Exception sending context destroyed event to listener instance of class org.springframework.web.context.ContextLoaderListener
  java.lang.ExceptionInInitializerError
      at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:80)
      at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4819)
      at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5466)
      at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
      at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:958)
      at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1599)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      at java.lang.Thread.run(Thread.java:722)
  Caused by: java.lang.IllegalStateException: org.slf4j.LoggerFactory could not be successfully initialized. See also http://www.slf4j.org/codes.html#unsuccessfulInit
      at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:288)
      at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:252)
      at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155)
      at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:131)
      at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:685)
      at org.springframework.web.context.ContextCleanupListener.&lt;clinit&gt;(ContextCleanupListener.java:43)
      ... 16 more
  </code></pre>
  
  <p>When I look at the deployed war file, I see in the war file the following jars (among others):</p>
  
  <pre><code>slf4j-api-1.6.4.jar
  slf4j-log4j12-1.6.4.jar
  </code></pre>
  
  <p>The strange thing is, that I don't see there any <code>log4j.jar</code> (even though it's a dependency of <code>slf4j-log4j12-1.6.4.jar</code></p>
  
  <p><strong>Questions:</strong></p>
  
  <ol>
  <li><p>Why was <code>log4j.jar</code> not packed in the war file?</p></li>
  <li><p>What does the error message mean and how to solve it?</p></li>
  </ol>