title: java.lang.NoClassDefFoundError: Could not initialize class xxx.xxx.xxx.HibernateUtil
body: <p>Herewith I added my source code of web.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app id="WebApp_ID" version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 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-app_3_0.xsd"&gt;
      &lt;display-name&gt;ussd&lt;/display-name&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;init&lt;/servlet-name&gt;
          &lt;jsp-file&gt;/init.jsp&lt;/jsp-file&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;javax.ws.rs.core.Application&lt;/param-name&gt;
          &lt;param-value&gt;com.dialog.mife.ussd.api.USSDApplication&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;resteasy.providers&lt;/param-name&gt;
          &lt;param-value&gt;com.dialog.mife.ussd.exception.NotFoundException&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;context-param&gt;
          &lt;param-name&gt;resteasy.servlet.mapping.prefix&lt;/param-name&gt;
          &lt;param-value&gt;/&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;listener&gt;
          &lt;listener-class&gt;org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap&lt;/listener-class&gt;
      &lt;/listener&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;Resteasy&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher&lt;/servlet-class&gt;
      &lt;/servlet&gt;
      &lt;servlet&gt;
          &lt;servlet-name&gt;ServletAdaptor&lt;/servlet-name&gt;
          &lt;servlet-class&gt;com.sun.jersey.spi.container.servlet.ServletContainer&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;Resteasy&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;ServletAdaptor&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/webresources/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>Hibernate.cfg.xml.
  My Web service project goes with Jersey+Hibernate..</p>
  
  <pre><code>    &lt;!DOCTYPE hibernate-configuration PUBLIC
      "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
      "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"&gt;
  &lt;hibernate-configuration&gt;
      &lt;session-factory&gt;   
          &lt;property name="hibernate.bytecode.use_reflection_optimizer"&gt;false&lt;/property&gt;
          &lt;property name="hibernate.connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
          &lt;property name="hibernate.connection.password"&gt;xxx&lt;/property&gt;
          &lt;property name="hibernate.connection.url"&gt;jdbc:mysql://localhost:3306/USSD&lt;/property&gt;
          &lt;property name="hibernate.connection.username"&gt;root&lt;/property&gt;
          &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;
          &lt;property name="show_sql"&gt;true&lt;/property&gt;   
          &lt;property name="hbm2ddl.auto"&gt;update&lt;/property&gt;
          &lt;property name="hibernate.transaction.factory_class"&gt;org.hibernate.transaction.JDBCTransactionFactory&lt;/property&gt;
          &lt;property name="connection.pool_size"&gt;1&lt;/property&gt;
          &lt;property name="hibernate.connection.autocommit"&gt;true&lt;/property&gt;
          &lt;mapping class="com.xxx.xxx.xxx.xxx.Application" /&gt;
  
      &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>Here is HibernateUtil Class</p>
  
  <pre><code>public class HibernateUtil {
      private static final SessionFactory sessionFactory;
      static {
          try {
              sessionFactory = new Configuration().configure().buildSessionFactory();
          } catch (Exception ex) {
              ex.printStackTrace();
              throw new ExceptionInInitializerError(ex);
          }
      }
  </code></pre>
  
  <p>Here is my error
  I added Hibernate latest jar files.
  [<strong>hibernate-core-4.3.7.Final.jar</strong>]</p>
  
  <pre><code>SEVERE: StandardWrapper.Throwable
  java.lang.NoClassDefFoundError: Could not initialize class com.dialog.mife.ussd.util.HibernateUtil
      at org.apache.jsp.init_jsp.jspInit(init_jsp.java:23)
      at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:48)
      at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:180)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
      at org.apache.jasper.servlet.JspServlet.init(JspServlet.java:138)
      at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5123)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5407)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:744)
  
  Nov 11, 2014 2:06:11 PM org.apache.catalina.core.StandardContext loadOnStartup
  SEVERE: Servlet /ussd threw load() exception
  java.lang.NoClassDefFoundError: Could not initialize class com.dialog.mife.ussd.util.HibernateUtil
      at org.apache.jsp.init_jsp.jspInit(init_jsp.java:23)
      at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:48)
      at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:180)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
      at org.apache.jasper.servlet.JspServlet.init(JspServlet.java:138)
      at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5123)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5407)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:744)
  </code></pre>
  
  <p>Please help me to sort out this issue
  thanks</p>