title: Hibernate & Tomcat
body: <p>I'm having trouble running a sample hibernate app on tomcat 7 + eclipse.  The app I'm running is the one provided at hibernate.org with minor changes to test the set up. </p>
  
  <p>When I attempt to access the session object the server throws an exception.  I did a plug-in search on the IDE and could not find the org.hibernate.session package in the hibernate3.jar file located in my src/lib.  However, eclipsed allowed the import without any error warnings..</p>
  
  <p>Stack trace:</p>
  
  <pre><code>type Exception report
  
  message
  
  description The server encountered an internal error () that prevented it from fulfilling this request.
  
  exception
  
  javax.servlet.ServletException: Error instantiating servlet class core.EmployeeManager
  org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
  org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
  org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
  org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:403)
  org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:301)
  org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:162)
  org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
  java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>root cause</p>
  
  <pre><code>java.lang.NoClassDefFoundError: org/hibernate/Session
  java.lang.Class.getDeclaredConstructors0(Native Method)
  java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
  java.lang.Class.getConstructor0(Unknown Source)
  java.lang.Class.newInstance0(Unknown Source)
  java.lang.Class.newInstance(Unknown Source)
  org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
  org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
  org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
  org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:403)
  org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:301)
  org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:162)
  org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
  java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>root cause</p>
  
  <pre><code>java.lang.ClassNotFoundException: org.hibernate.Session
  org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
  org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
  java.lang.Class.getDeclaredConstructors0(Native Method)
  java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
  java.lang.Class.getConstructor0(Unknown Source)
  java.lang.Class.newInstance0(Unknown Source)
  java.lang.Class.newInstance(Unknown Source)
  org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
  org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
  org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
  org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:403)
  org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:301)
  org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:162)
  org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
  java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
  java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  java.lang.Thread.run(Unknown Source)
  note The full stack trace of the root cause is available in the Apache Tomcat/7.0.16 logs.
  </code></pre>
  
  <p>Thank you,
  Nguyen</p>