I am developing a web application using the Hibernate framework. I got this error while trying to start webapp.
Error Console:
Exception caught in Create Account Dataorg.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer] java.lang.NullPointerException
My mapping file (hbm.xml):
<?xml version="1.0" encoding="utf-8"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping> <class name="org.vgec.bean.CreateAccount" table="CreateAccount" > <id name="enrollment_number" type="java.lang.String"> <column name="enrollment_number" length="20"/> <generator class="assigned" /> </id> <property name="activation_code" type="java.lang.String"> <column name="activation_code" length="50"/> </property> </class> </hibernate-mapping>
DataAccessObject File Code:
public void addCreateAccount(CreateAccount act) throws Exception { Session session = null; try{
Here an exception is thrown in the above code - the line in catch is displayed in an error on the console.
Here is my bean or POJO file:
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; } }
- I checked the solutions of other threads.
- I have included
javaassist.jar file - All installers and recipients have no typos.
- I also have
java.lang.NullPointerException .
What is the reason for this error?
Parth source share