title: how to fix "HTTP Status 500- Servlet exception threw an exception"
body: <p>i got this erore and i don't know what's wrong
  i just want to check the username &amp; password and then enter a page that shows it login or not</p>
  
  <pre><code>package cse;
  import java.io.IOException;
  import java.security.NoSuchAlgorithmException;
  import java.util.Date;
  import java.util.Random;
  
  import javax.servlet.ServletException;
  import javax.servlet.annotation.WebServlet;
  import javax.servlet.http.HttpServlet;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  import javax.servlet.http.HttpSession;
  
  @SuppressWarnings("serial")
  @WebServlet(urlPatterns = {"/LogIn"})
  public class LogIn extends HttpServlet {
  
  @Override
  public void doPost(HttpServletRequest request, HttpServletResponse response) 
      throws IOException {
      String username = request.getParameter("username");
      String password = request.getParameter("password");
  
      User signedInUser = User.login(username, password);
  
      if(!signedInUser.equals(null)){
           HttpSession s = request.getSession();
           s.setAttribute("signedInKey", (new Date()).getTime() + (new         Random()).nextInt(999999999));
           request.setAttribute("user", signedInUser);
           String url = "http://localhost:8080/java_project/test.jsp";
           response.sendRedirect(url);
      }
  
      String url = "http://localhost:8080/java_project/notLogIn.jsp";
      response.sendRedirect(url);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>and this is the error</p>
  
  <pre><code>HTTP Status 500 - Servlet execution threw an exception
  
     --------------------------------------------------------------------------------
  
  type Exception report
  
  message Servlet execution threw an exception
  
  description The server encountered an internal error that prevented it from fulfilling       this request.
  
  exception 
  
  javax.servlet.ServletException: Servlet execution threw an exception
  
  
   root cause 
  
  java.lang.NoClassDefFoundError: org/hibernate/Session
  ir.ac.shirazu.cse.LogIn.doPost(LogIn.java:25)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
  
  
   root cause 
  
   java.lang.ClassNotFoundException: org.hibernate.Session
  org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
  org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
  ir.ac.shirazu.cse.LogIn.doPost(LogIn.java:25)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
  
  
     note The full stack trace of the root cause is available in the Apache Tomcat/7.0.40 logs.
  
  
      --------------------------------------------------------------------------------
  
      Apache Tomcat/7.0.40
  </code></pre>
  
  <p>plz help , i really can't understand what's wrong</p>