title: java.lang.NoClassDefFoundError: net/sf/hibernate/HibernateException
body: <p>I am developing a JSF webapp with Hibernate. I tested with a main class and I can insert in database, but I can't deploy my webapp to Glassfish. It always errors with HTTP 500 error. Here is my code:</p>
  
  <p><code>faces-config</code>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee"
   xmlns:xi="http://www.w3.org/2001/XInclude"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"&gt;
   &lt;application&gt;
          &lt;view-handler&gt;com.sun.facelets.FaceletViewHandler&lt;/view-handler&gt;
      &lt;/application&gt;
  
   &lt;managed-bean&gt;
    &lt;managed-bean-name&gt;timesheetBean&lt;/managed-bean-name&gt;
    &lt;managed-bean-class&gt;hibernate.timeBean.TimesheetBean&lt;/managed-bean-class&gt;
    &lt;managed-bean-scope&gt;session&lt;/managed-bean-scope&gt;
   &lt;/managed-bean&gt;
   &lt;navigation-rule&gt;
    &lt;from-view-id&gt;/EditTimesheet.jsp&lt;/from-view-id&gt;
   &lt;/navigation-rule&gt;
  &lt;/faces-config&gt;
  </code></pre>
  
  <p><code>web.xml</code>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"&gt;
    &lt;display-name&gt;test&lt;/display-name&gt;
  
    &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
      &lt;welcome-file&gt;index.htm&lt;/welcome-file&gt;
      &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.html&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.htm&lt;/welcome-file&gt;
      &lt;welcome-file&gt;default.jsp&lt;/welcome-file&gt;
    &lt;/welcome-file-list&gt;
    &lt;context-param&gt;
          &lt;param-name&gt;javax.faces.STATE_SAVING_METHOD&lt;/param-name&gt;
          &lt;param-value&gt;client&lt;/param-value&gt;
      &lt;/context-param&gt;
  
      &lt;filter&gt;
          &lt;display-name&gt;RichFaces Filter&lt;/display-name&gt;
          &lt;filter-name&gt;richfaces&lt;/filter-name&gt;
          &lt;filter-class&gt;org.ajax4jsf.Filter&lt;/filter-class&gt;
      &lt;/filter&gt;
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;richfaces&lt;/filter-name&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
          &lt;dispatcher&gt;REQUEST&lt;/dispatcher&gt;
          &lt;dispatcher&gt;FORWARD&lt;/dispatcher&gt;
          &lt;dispatcher&gt;INCLUDE&lt;/dispatcher&gt;
      &lt;/filter-mapping&gt;
  
  
      &lt;context-param&gt;
          &lt;param-name&gt;org.ajax4jsf.VIEW_HANDLERS&lt;/param-name&gt;
          &lt;param-value&gt;com.sun.facelets.FaceletViewHandler&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;javax.faces.DEFAULT_SUFFIX&lt;/param-name&gt;
          &lt;param-value&gt;.xhtml&lt;/param-value&gt;
      &lt;/context-param&gt;
  
      &lt;servlet&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;*.jsf&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
      &lt;session-config&gt;
          &lt;session-timeout&gt;30&lt;/session-timeout&gt;
      &lt;/session-config&gt;
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p><code>EditTimesheet.jsp</code>:</p>
  
  <pre><code>&lt;%@ page language="java" pageEncoding="ISO-8859-1"%&gt;
  &lt;%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %&gt;
  &lt;%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %&gt;
  
  &lt;%
  String path = request.getContextPath();
  String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
  %&gt;
  
  &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;base href="&lt;%=basePath%&gt;"&gt;
  
      &lt;title&gt;My JSF 'EditDepartement.jsp' starting page&lt;/title&gt;
  
      &lt;meta http-equiv="pragma" content="no-cache"&gt;
      &lt;meta http-equiv="cache-control" content="no-cache"&gt;
      &lt;meta http-equiv="expires" content="0"&gt;    
      &lt;meta http-equiv="keywords" content="keyword1,keyword2,keyword3"&gt;
      &lt;meta http-equiv="description" content="This is my page"&gt;
      &lt;!--
      &lt;link rel="stylesheet" type="text/css" href="styles.css"&gt;
      --&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;f:view&gt;
          &lt;h:form&gt;
          &lt;h:inputHidden id="id" value="#{timesheetBean.currentTimesheet.id}" /&gt;
          &lt;h:panelGrid columns="2" border="1"&gt;
              &lt;h:inputText value="#{timesheetBean.currentTimesheet.action}"&gt;
              &lt;/h:inputText&gt;
              &lt;h:outputText value="heure:" /&gt;
              &lt;h:inputText value="#{timesheetBean.currentTimesheet.heure}"&gt;
              &lt;/h:inputText&gt;
              &lt;h:outputText value="date:" /&gt;
              &lt;h:inputText value="#{timesheetBean.currentTimesheet.date}"&gt;
              &lt;/h:inputText&gt;
  
  &lt;/h:panelGrid&gt;
          &lt;h:commandButton value="Save" action="listeDepartements" actionListener="#{timesheetBean.saveTimesheet}" /&gt;
          &lt;h:commandButton value="Annuler" action="listeTimesheet"/&gt;
      &lt;/h:form&gt;
      &lt;/f:view&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The exeception is:</p>
  
  <pre><code>javax.servlet.ServletException: net/sf/hibernate/HibernateException
  
   root cause: java.lang.NoClassDefFoundError: net/sf/hibernate/HibernateException
  </code></pre>
  
  <p>How is this caused and how can I solve it?</p>