title: NoSuchMethodError: org/apache/log4j/Logger.setLevel(Lorg/apache/log4j/Level;)
body: <p>I am using these log4j, slf4j and ch.qos.logback dependencies in my pom.xml of my java project:</p>
  
  <pre><code>        &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
              &lt;version&gt;1.6.4&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;ch.qos.logback&lt;/groupId&gt;
              &lt;artifactId&gt;logback-core&lt;/artifactId&gt;
              &lt;version&gt;1.1.2&lt;/version&gt;
          &lt;/dependency&gt;
              &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;jcl-over-slf4j&lt;/artifactId&gt;
              &lt;version&gt;1.6.4&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;log4j-over-slf4j&lt;/artifactId&gt;
              &lt;version&gt;1.6.4&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;jul-to-slf4j&lt;/artifactId&gt;
              &lt;version&gt;1.6.4&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;log4j&lt;/groupId&gt;
              &lt;artifactId&gt;log4j&lt;/artifactId&gt;
              &lt;version&gt;1.2.14&lt;/version&gt;
          &lt;/dependency&gt;
  </code></pre>
  
  <p>I recently wanted to use an external servlet library and defined that dependency in pom. The init method of this servlet looks like this:</p>
  
  <pre><code>import org.apache.log4j.Level;
  import org.apache.log4j.Logger;
  
  ....
  
  public class HealthpageServlet extends HttpServlet{
      private static final long serialVersionUID = 1L;
      private final Logger logger = Logger.getLogger(HealthpageServlet.class.getName());
  
      protected HealthpageService service; 
  
      public static final String VERSION = "Healthpage-Version 0.0.4";
  
      public void init() throws ServletException {
          logger.setLevel(Level.INFO);
          .....
      }
  </code></pre>
  
  <p>My Weblogic Server shows me this exception from the init method, when i start the server:</p>
  
  <blockquote>
    <p>java.lang.NoSuchMethodError:
    org/apache/log4j/Logger.setLevel(Lorg/apache/log4j/Level;)V</p>
  </blockquote>
  
  <p>When i in eclipse open that HealthpageServlet jar content, it has a log4j-1.2.15 jar inside the WEB-INF/lib folder. But even if i exclude that dependency from pom.xml, i see this exception and my server does not start. What is the problem?</p>