title: Hibernate - java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
body: <p>I tried to run easy program with hibernate and HSQLDB. </p>
  
  <p>I'm using <code>log4j</code> for this project with <code>log4j.properties</code>:</p>
  
  <pre><code># Direct log messages to stdout
  log4j.appender.stdout=org.apache.log4j.ConsoleAppender
  log4j.appender.stdout.Target=System.out
  log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
  log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %c{1}:%L - %m%n
  
  # Root logger option
  log4j.rootLogger=INFO, stdout
  
  # Hibernate logging options (INFO only shows startup messages)
  log4j.logger.org.hibernate=INFO
  
  # Log JDBC bind parameter runtime arguments
  log4j.logger.org.hibernate.type=INFO
  </code></pre>
  
  <p>and all is build with <code>Ant</code>, build file you can <a href="http://pastebin.com/x13SzwB0" rel="nofollow noreferrer">see here</a>.</p>
  
  <p>But when I run <code>schemaexport</code> target I caught next error:</p>
  
  <pre><code>BUILD FAILED
  /home/nazar_art/workspace/Persistance/build.xml:64: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/uJisw.png" alt="schemaexport error"></p>
  
  <p>But I hasn't use <code>slf4j</code> why this caused?</p>
  
  <p>here is my content of <code>lib</code> folder with all jars that It uses:</p>
  
  <p><img src="https://i.stack.imgur.com/PtUY8.png" alt="lib struckture"></p>
  
  <p>I couldn't figure out why does this happen?</p>
  
  <p>Here is better project structure:</p>
  
  <p><img src="https://i.stack.imgur.com/FiYHI.png" alt="project struckture"></p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I added <code>slf4j-api-1.6.1.jar</code> and <code>slf4j-log4j12-1.6.1.jar</code> but it throws:</p>
  
  <blockquote>
    <p>BUILD FAILED
    /home/nazar_art/workspace/Persistance/build.xml:64: 
    java.lang.NoClassDefFoundError: javax/persistence/EntityListeners</p>
  </blockquote>
  
  <p>you can see here how it looks:</p>
  
  <p><img src="https://i.stack.imgur.com/B2wnN.png" alt="entity listeners"></p>
  
  <p><strong>How to solve this trouble?</strong></p>