title: java.lang.ClassNotFoundException: org.hibernate.cfg.AnnotationConfiguration
body: <p>I'v got the following problem:
  I tried to create a simple Servlep with Eclipse:</p>
  
  <pre><code>@WebServlet(description = "Adress book servlet", urlPatterns = {"/new_address"})
  public class CAddressBookServlet extends HttpServlet 
  {
      public CAddressBookServlet() 
      {
          super();
      }
      protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 
      {}
      protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 
      {}
      private static final long serialVersionUID = 1L;
  }
  </code></pre>
  
  <p>And it works fine with Tomcat!
  But then I was to add Hibernate functionality into my project. I add just one line to servlet contructor:</p>
  
  <pre><code>@WebServlet(description = "Adress book servlet", urlPatterns = {"/new_address"})
  public class CAddressBookServlet extends HttpServlet 
  {
      public CAddressBookServlet() 
      {
          super();
          new AnnotationConfiguration();
      }
      protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 
      {}
      protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException 
      {}
      private static final long serialVersionUID = 1L;
  }
  </code></pre>
  
  <p>Which cause the following error:</p>
  
  <blockquote>
    <p>HTTP Status 500 - Error instantiating servlet class
    org.servlets.CAddressBookServlet</p>
    
    <hr>
    
    <p>type Exception report</p>
    
    <p>message Error instantiating servlet class
    org.servlets.CAddressBookServlet</p>
    
    <p>description The server encountered an internal error that prevented it
    from fulfilling this request.</p>
    
    <p>exception </p>
    
    <p>javax.servlet.ServletException: Error instantiating servlet class
    org.servlets.CAddressBookServlet
      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
      org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:931)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
      org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
      org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
      org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
      java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      java.lang.Thread.run(Unknown Source)</p>
    
    <p>root cause </p>
    
    <p>java.lang.NoClassDefFoundError:
    org/hibernate/cfg/AnnotationConfiguration
      org.servlets.CAddressBookServlet.(CAddressBookServlet.java:33)
      sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
      sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
    Source)   java.lang.reflect.Constructor.newInstance(Unknown Source)
      java.lang.Class.newInstance0(Unknown Source)
      java.lang.Class.newInstance(Unknown Source)
      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
      org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:931)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
      org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
      org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
      org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
      java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      java.lang.Thread.run(Unknown Source)</p>
    
    <p>root cause </p>
    
    <p>java.lang.ClassNotFoundException:
    org.hibernate.cfg.AnnotationConfiguration
      org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
      org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
      org.servlets.CAddressBookServlet.(CAddressBookServlet.java:33)
      sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
      sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
    Source)   java.lang.reflect.Constructor.newInstance(Unknown Source)
      java.lang.Class.newInstance0(Unknown Source)
      java.lang.Class.newInstance(Unknown Source)
      org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
      org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
      org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:931)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
      org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
      org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
      org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
      java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      java.lang.Thread.run(Unknown Source)</p>
    
    <p>note The full stack trace of the root cause is available in the Apache
    Tomcat/7.0.33 logs.</p>
  </blockquote>
  
  <p>How can I make hibernate working with my servlet?</p>