title: I am trying to connect to a mysql database with hibernate xml mapping but I am getting this error
body: <p>This is my output it shows that I could not get a constructor from org.hibernate.persister.entity.SingleTableEntityPersister. As far as I can tell it has managed to access the log on to the database. The error starts soon after that.</p>
  
  <pre><code>            Jan 21, 2016 9:19:44 PM org.hibernate.Version logVersion
              INFO: HHH000412: Hibernate Core {5.0.6.Final}
              Jan 21, 2016 9:19:44 PM org.hibernate.cfg.Environment &lt;clinit&gt;
              INFO: HHH000206: hibernate.properties not found
              Jan 21, 2016 9:19:44 PM org.hibernate.cfg.Environment          buildBytecodeProvider
  INFO: HHH000021: Bytecode provider name : javassist
  Jan 21, 2016 9:19:45 PM org.hibernate.annotations.common.reflection.java.JavaReflectionManager &lt;clinit&gt;
  INFO: HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
  Jan 21, 2016 9:19:45 PM org.hibernate.boot.jaxb.internal.stax.LocalXmlResourceResolver resolveEntity
  WARN: HHH90000012: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/hibernate-mapping. Use namespace http://www.hibernate.org/dtd/hibernate-mapping instead.  Support for obsolete DTD/XSD namespaces may be removed at any time.
  Jan 21, 2016 9:19:47 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
  WARN: HHH10001002: Using Hibernate built-in connection pool (not for production use!)
  Jan 21, 2016 9:19:47 PM `enter code here`org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
  INFO: HHH10001005: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql://localhost:3306/rhs]
  Jan 21, 2016 9:19:47 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
  INFO: HHH10001001: Connection properties: {user=root, password=****}
  Jan 21, 2016 9:19:47 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
  INFO: HHH10001003: Autocommit mode: false
  Jan 21, 2016 9:19:47 PM org.hibernate.engine.jdbc.connections.internal.PooledConnections &lt;init&gt;
  INFO: HHH000115: Hibernate connection pool size: 20 (min=1)
  Jan 21, 2016 9:19:48 PM org.hibernate.dialect.Dialect &lt;init&gt;
  INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect
  Exception in thread "main" org.hibernate.MappingException: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister
      at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:123)
      at org.hibernate.persister.internal.PersisterFactoryImpl.createEntityPersister(PersisterFactoryImpl.java:77)
      at org.hibernate.internal.SessionFactoryImpl.&lt;init&gt;(SessionFactoryImpl.java:346)
      at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:708)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:724)
      at JavaUtil.main(JavaUtil.java:20)
  Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]
      at org.hibernate.tuple.entity.EntityTuplizerFactory.constructTuplizer(EntityTuplizerFactory.java:91)
      at org.hibernate.tuple.entity.EntityTuplizerFactory.constructDefaultTuplizer(EntityTuplizerFactory.java:116)
      at org.hibernate.tuple.entity.EntityMetamodel.&lt;init&gt;(EntityMetamodel.java:388)
      at org.hibernate.persister.entity.AbstractEntityPersister.&lt;init&gt;(AbstractEntityPersister.java:509)
      at org.hibernate.persister.entity.SingleTableEntityPersister.&lt;init&gt;(SingleTableEntityPersister.java:124)
      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.createEntityPersister(PersisterFactoryImpl.java:96)
      ... 6 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:88)
      ... 15 more
  Caused by: org.hibernate.PropertyNotFoundException: Could not locate setter method for property [Profession#SALARY]
      at org.hibernate.internal.util.ReflectHelper.findSetterMethod(ReflectHelper.java:532)
      at org.hibernate.property.access.internal.PropertyAccessBasicImpl.&lt;init&gt;(PropertyAccessBasicImpl.java:44)
      at org.hibernate.property.access.internal.PropertyAccessStrategyBasicImpl.buildPropertyAccess(PropertyAccessStrategyBasicImpl.java:27)
      at org.hibernate.mapping.Property.getGetter(Property.java:299)
      at org.hibernate.tuple.entity.PojoEntityTuplizer.buildPropertyGetter(PojoEntityTuplizer.java:270)
      at org.hibernate.tuple.entity.AbstractEntityTuplizer.&lt;init&gt;(AbstractEntityTuplizer.java:145)
      at org.hibernate.tuple.entity.PojoEntityTuplizer.&lt;init&gt;(PojoEntityTuplizer.java:63)
      ... 20 more
  </code></pre>
  
  <p>This is a simple POJO class</p>
  
  <pre><code>import javax.persistence.*;
  
  public class Profession {
      private int EDUCATION;
      private int HOURS;
      private String JOB_OUTLOOK;
      private String JOBTITLE;
      private double SALARY;
      private String UPWARD_MOBILITY;
  
      public Profession() {
      }
  
      public int getEDUCATION() {
          return EDUCATION;
      }
  
      public void setEDUCATION(int eDUCATION) {
          EDUCATION = eDUCATION;
      }
  
      public int getHOURS() {
          return HOURS;
      }
  
      public void setHOURS(int hOURS) {
          HOURS = hOURS;
      }
  
      public String getJOB_OUTLOOK() {
          return JOB_OUTLOOK;
      }
  
      public void setJOB_OUTLOOK(String jOB_OUTLOOK) {
          JOB_OUTLOOK = jOB_OUTLOOK;
      }
  
      public String getJOBTITLE() {
          return JOBTITLE;
      }
  
      public void setJOBTITLE(String jOBTITLE) {
          JOBTITLE = jOBTITLE;
      }
  
      public double getSALARY() {
          return SALARY;
      }
  
      public void setSALRAY(double sALARY) {
          SALARY = sALARY;
      }
  
      public String getUPWARD_MOBILITY() {
          return UPWARD_MOBILITY;
      }
  
      public void setUPWARD_MOBILITY(String uPWARD_MOBILITY) {
          UPWARD_MOBILITY = uPWARD_MOBILITY;
      }
  }
  </code></pre>
  
  <p>This is my main class</p>
  
  <pre><code>import org.hibernate.*;
  import org.hibernate.cfg.*;
  
  import java.util.Scanner;
  import java.awt.*;
  import java.awt.image.*;
  import java.io.*;
  
  import javax.imageio.*;
  import javax.swing.*;
  
  public class JavaUtil {
      public JavaUtil() {
      }
  
      public static void main(String[] args) throws IOException {
          Configuration cfg = new Configuration();
          cfg.configure("hibernate.cfg.xml");
  
          SessionFactory factory = cfg.buildSessionFactory();
          Session session = factory.openSession();
          Profession p = new Profession();
  
  
          // closing session
          Transaction tx = session.beginTransaction();
          session.save(p);
          System.out.println("Object saved successfully.....!!");
  
          tx.commit();
          session.close();
          factory.close();
      }
  
  }
  </code></pre>
  
  <p>This is my hibernate config file</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://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"&gt;
  &lt;hibernate-configuration&gt;
  &lt;session-factory&gt;
  
  &lt;!-- Related to the connection START --&gt;
  &lt;property name="connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
  &lt;property name="connection.url"&gt;jdbc:mysql://localhost:3306/rhs &lt;/property&gt;
  &lt;property name="connection.user"&gt;root&lt;/property&gt;
  &lt;property name="connection.password"&gt;root&lt;/property&gt;
  &lt;!-- Related to the connection END --&gt;
  
  &lt;!-- Related to hibernate properties START --&gt;
  &lt;property name="show_sql"&gt;true &lt;/property&gt;
  &lt;property name="dialet"&gt;org.hibernate.dialect.MySqlDialect &lt;/property&gt;
  &lt;property name="hbm2ddl.auto"&gt;update &lt;/property&gt;
  &lt;!-- Related to hibernate properties END --&gt;
  
  &lt;!-- Related to mapping START --&gt;
  &lt;mapping resource="profession.hbm.xml" /&gt;
  &lt;!-- Related to the mapping END --&gt;
  
  &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt; 
  </code></pre>
  
  <p>This is xml mapping</p>
  
  <pre><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="Profession" table="profession"&gt;
  
  &lt;id name="JOBTITLE" column="JOBTITLE"  &gt;
  &lt;generator class="assigned" /&gt;
  &lt;/id&gt;
  
  &lt;property name="EDUCATION"/&gt;
  &lt;property name="HOURS"/&gt;
  &lt;property name="JOB_OUTLOOK"/&gt;
  &lt;property name="SALARY"/&gt;
  &lt;property name="UPWARD_MOBILITY"/&gt;
  &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>