title: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
body: <p>I am developing a web application using Hibernate framework. I got this error when trying to run webapp.</p>
  
  <p>Error Console:</p>
  
  <pre class="lang-java prettyprint-override"><code>Exception caught in Create Account Dataorg.hibernate.HibernateException: Unable to
  instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
  java.lang.NullPointerException
  </code></pre>
  
  <p>My mapping file (hbm.xml) :</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
  "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"&gt;
  &lt;hibernate-mapping&gt;
  &lt;class name="org.vgec.bean.CreateAccount" table="CreateAccount" &gt;
          &lt;id name="enrollment_number" type="java.lang.String"&gt;
              &lt;column name="enrollment_number" length="20"/&gt;
              &lt;generator class="assigned" /&gt;
          &lt;/id&gt;
         &lt;property name="activation_code" type="java.lang.String"&gt;
          &lt;column name="activation_code" length="50"/&gt;
         &lt;/property&gt;
  
  
  &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>DataAccessObject file code:</p>
  
  <pre class="lang-java prettyprint-override"><code>public void addCreateAccount(CreateAccount act) throws Exception {
  
      Session session = null;
  
      try{
          //this step will read hibernate.cfg.xml
          SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
          session = sessionFactory.openSession();
          Transaction tx = session.beginTransaction();
          session.save(act);
          tx.commit();
  
      }catch(Exception e) {
          System.out.println("Exception caught in Create Account Data" + e);
      }finally{
          session.flush();
          session.close();
      }
  
  }
  </code></pre>
  
  <p>Here in Above code Exception is thrown - the string in catch is displayed in the error in console.</p>
  
  <p>Here is my bean Or POJO file:</p>
  
  <pre class="lang-java prettyprint-override"><code>package org.vgec.bean;
  
  public class CreateAccount {
  
      private String enrollment_number;
      private String activation_code;
  
      public String getEnrollment_number() {
          return enrollment_number;
      }
  
      public void setEnrollment_number(String enrollment_number) {
          this.enrollment_number = enrollment_number;
      }
  
      public String getActivation_code() {
          return activation_code;
      }
  
      public void setActivation_code(String activation_code) {
          this.activation_code = activation_code;
      }
  
  }
  </code></pre>
  
  <ul>
  <li>I have checked the other threads solutions. </li>
  <li>I have included <code>javaassist.jar</code> file</li>
  <li>All the setter and getter do not have any typos. </li>
  <li>I'm also having <code>java.lang.NullPointerException</code>.</li>
  </ul>
  
  <p>What is the root cause of this error?</p>