Friday, December 27, 2013

Initial SessionFactory creation failed.org.hibernate.MappingException:


Initial SessionFactory creation failed.org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
Exception in thread "main" java.lang.ExceptionInInitializerError
   at com.ranga.util.HibernateUtil.<clinit>(HibernateUtil.java:20)
   at com.ranga.App.main(App.java:14)

Problem:  
While setting the setters or getters setting the different name. for example,

class Address {
  private Employee employee;
  public Employee getPerson() {
     return employee;
 }
 public void setPerson(Employee employee) {
    this.employee = employee;
 }
---------------------------
}

Solution: 
Don’t type getter and setters manually. Use IDE short cut to generate the getters and setters.

0 comments: