title: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
body: <p>I am actually new to hibernate and tried to set up 2 classes. Account and Person. Now all i try to do is create a one to one bidirectional dependency using annotations. Here are some details and code snippets:</p>
  
  <p>Here are my libraries which i added to the build path, maybe i missed anything:</p>
  
  <p><a href="http://prntscr.com/1jbew4">http://prntscr.com/1jbew4</a></p>
  
  <p>Account:</p>
  
  <pre><code>package backend;
  
  import java.util.Random;
  import java.util.Collection;
  import java.util.TreeSet;
  import javax.persistence.*;
  
  @Entity
  @Table(name = "Account")
  public class Account {
  
      public static Random rnd = new Random();
      private int id;
      private String username;
      private long password;
      private long salt;
      private Person person;
      private String role;
      private Collection&lt;Account&gt; friendlist;
  
      public Account() {
  
      }
  
      public Account(String username, long password, Person person, String role) {
          super();
          this.username = username;
          this.password = password;
          this.setSalt();
          this.person = person;
          this.role = role;
          this.friendlist = new TreeSet&lt;Account&gt;();
      }
  
      @Id
      @GeneratedValue
      @Column(name = "Id")
      public int getId() {
          return id;
      }
  
      public void setId(int id) {
          this.id = id;
      }
  
      @Column(name = "Username")
      public String getUsername() {
          return username;
      }
  
      public void setUsername(String username) {
          this.username = username;
      }
  
      @Column(name = "Password")
      public long getPassword() {
          return password;
      }
  
      public void setPassword(String password) {
          this.password = (long) salt + password.hashCode();
      }
  
      @Column(name = "Salt")
      public long getSalt() {
          return salt;
      }
  
      public void setSalt() {
          this.salt = rnd.nextLong();
          if (this.salt &lt; 0) {
              this.salt = this.salt * (-1);
          }
      }
  
      @OneToOne(cascade = CascadeType.ALL)
      @JoinColumn(name = "Person_FK")
      public Person getPerson() {
          return person;
      }
  
      public void setPerson(Person person) {
          this.person = person;
      }
  
      @Column(name = "Role")
      public String getRole() {
          return role;
      }
  
      public void setRole(String role) {
  }
  </code></pre>
  
  <p>Person:</p>
  
  <pre><code>package backend;
  
  import javax.persistence.*;
  
  @Entity
  @Table(name ="Person")
  public class Person {
  
      private int id;
      private String firstName;
      private String lastName;
      private String street;
      private int houseNumber;
      private String tel;
      private String email;
      private String mobile;
      private Account account;
  
      public Person() {
  
      }
  
      public Person(int id, String firstName, String lastName, String street,
              int houseNumber, String tel, String email, String mobile,
              Account account) {
          super();
          this.id= id;
          this.firstName = firstName;
          this.lastName = lastName;
          this.street = street;
          this.houseNumber = houseNumber;
          this.tel = tel;
          this.email = email;
          this.mobile = mobile;
          this.account = account;
      }
  
      @Id
      @GeneratedValue
      @Column(name="Id")
      public int getId() {
          return id;
      }
  
      public void setId(int id) {
          this.id = id;
      }
  
      @Column(name="Firstname")
      public String getFirstName() {
          return firstName;
      }
  
      public void setFirstName(String firstName) {
          this.firstName = firstName;
      }
  
  
      @Column(name="Lastname")
      public String getLastName() {
          return lastName;
      }
  
      public void setLastName(String lastName) {
          this.lastName = lastName;
      }
  
      @Column(name="Street")
      public String getStreet() {
          return street;
      }
  
      public void setStreet(String street) {
          this.street = street;
      }
  
      @Column(name="Housenumber")
      public int getHouseNumber() {
          return houseNumber;
      }
  
      public void setHouseNumber(int houseNumber) {
          this.houseNumber = houseNumber;
      }
  
      @Column(name="Tel")
      public String getTel() {
          return tel;
      }
  
      public void setTel(String tel) {
          this.tel = tel;
      }
  
      @Column(name="Email")
      public String getEmail() {
          return email;
      }
  
      public void setEmail(String email) {
          this.email = email;
      }
  
      @Column(name="Mobile")
      public String getMobile() {
          return mobile;
      }
  
      public void setMobile(String mobile) {
          this.mobile = mobile;
      }
  
      @OneToOne(mappedBy = "person", cascade = CascadeType.ALL)   
      public Account getAccount() {
          return account;
      }
  
      public void setAccount(Account account) {
          this.account = account;
      }
  }
  </code></pre>
  
  <p>Hibernate cfg xml:</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt;
  &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;!-- Alternative 1: MySQL --&gt;
  
          &lt;!-- Database connection settings: MySQL --&gt;
          &lt;property name="connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
          &lt;property name="connection.url"&gt;jdbc:mysql:///chat.application.db&lt;/property&gt;
          &lt;property name="connection.username"&gt;root&lt;/property&gt;
          &lt;property name="connection.password"&gt;&lt;/property&gt;
          &lt;property name="dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;
  
  
          &lt;!-- JDBC connection pool (use the built-in) --&gt;
          &lt;property name="connection.pool_size"&gt;1&lt;/property&gt;
  
  
          &lt;!-- Enable Hibernate's automatic session context management --&gt;
          &lt;property name="current_session_context_class"&gt;thread&lt;/property&gt;
  
          &lt;!-- Disable the second-level cache --&gt;
          &lt;property name="cache.provider_class"&gt;org.hibernate.cache.NoCacheProvider&lt;/property&gt;
  
          &lt;!-- Echo all executed SQL to stdout --&gt;
          &lt;property name="show_sql"&gt;true&lt;/property&gt;
          &lt;property name="format_sql"&gt;true&lt;/property&gt;
  
          &lt;!-- Drop and re-create the database schema on startup --&gt;
          &lt;property name="hbm2ddl.auto"&gt;create&lt;/property&gt;
  
          &lt;property name="hibernate.format_sql"&gt;true&lt;/property&gt;
  
          &lt;!-- Auflistung der gemappten Klassen (Package + Class-Name) --&gt;
          &lt;mapping class="backend.Account"/&gt;
          &lt;mapping class="backend.Person"/&gt;
  
          &lt;!-- &lt;mapping class="backend.Role"/&gt; --&gt;
      &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>And here is my problem. when i try to start  a simple main class creating some objects and saving them, just to test, i get this:</p>
  
  <p><strong>( %%%% Error Creating SessionFactory %%%%  = result of my try-catch before printStackTrace)</strong></p>
  
  <pre><code>INFO: HHH000397: Using ASTQueryTranslatorFactory
  %%%% Error Creating SessionFactory %%%% 
  org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
      at org.hibernate.persister.internal.PersisterFactoryImpl.create(PersisterFactoryImpl.java:185)
      at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:135)
      at org.hibernate.internal.SessionFactoryImpl.&lt;init&gt;(SessionFactoryImpl.java:385)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1769)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
      at backend.HibernateSessionFactory.currentSession(HibernateSessionFactory.java:21)
      at backend.HibernateSessionFactory.getCfg(HibernateSessionFactory.java:48)
      at backend.Main.main(Main.java:14)
  Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
      at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:138)
      at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTuplizer(EntityTuplizerFactory.java:188)
      at org.hibernate.tuple.entity.EntityMetamodel.&lt;init&gt;(EntityMetamodel.java:341)
      at org.hibernate.persister.entity.AbstractEntityPersister.&lt;init&gt;(AbstractEntityPersister.java:507)
      at org.hibernate.persister.entity.SingleTableEntityPersister.&lt;init&gt;(SingleTableEntityPersister.java:146)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
      at java.lang.reflect.Constructor.newInstance(Unknown Source)
      at org.hibernate.persister.internal.PersisterFactoryImpl.create(PersisterFactoryImpl.java:163)
      ... 7 more
  Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
      at java.lang.reflect.Constructor.newInstance(Unknown Source)
      at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:135)
      ... 16 more
  Caused by: org.hibernate.PropertyNotFoundException: Could not find a setter for property salt in class backend.Account
      at org.hibernate.property.BasicPropertyAccessor.createSetter(BasicPropertyAccessor.java:252)
      at org.hibernate.property.BasicPropertyAccessor.getSetter(BasicPropertyAccessor.java:245)
      at org.hibernate.mapping.Property.getSetter(Property.java:326)
      at org.hibernate.tuple.entity.PojoEntityTuplizer.buildPropertySetter(PojoEntityTuplizer.java:444)
      at org.hibernate.tuple.entity.AbstractEntityTuplizer.&lt;init&gt;(AbstractEntityTuplizer.java:201)
      at org.hibernate.tuple.entity.PojoEntityTuplizer.&lt;init&gt;(PojoEntityTuplizer.java:82)
      ... 21 more
  Exception in thread "main" java.lang.NullPointerException
      at backend.HibernateSessionFactory.currentSession(HibernateSessionFactory.java:28)
      at backend.HibernateSessionFactory.getCfg(HibernateSessionFactory.java:48)
      at backend.Main.main(Main.java:14)
  </code></pre>
  
  <p>So i really dont know how to handle this exception. I tried to google it and such but all i found out is that some people had spelling mistakes in their code and this was the reason for it. but unfortunately i dont have spellies in my code. Can someone help me? I will be happy to also post  my SessionFactoryCode or the main class if neccessary. Due to the fact that i am new to hibernate i take every advise =) </p>
  
  <p>BTW: SQL DB is running via XAMPP.</p>
  
  <p>Thanks.</p>