title: Could not get constructor for org.hibernate.persister.entity.SingleTableEntityPersister - BuldSession Error
body: <p>somebody know why this keeps happening?
  I'm using Hibernate, Mysql, Maven, Spring.
  I've looking in every post but i can't find the solution.
  Thank you :)</p>
  
  <pre><code>Class Libro
  
  package com.webservice.serviceDos;
  
  import javax.persistence.Column;
  import javax.persistence.Entity;
  import javax.persistence.Id;
  import javax.persistence.Table;
  
  @Entity
  @Table(name = "libros")
  public class Libro implements java.io.Serializable
  {
      private int libroIsbn;
      private String libroAutor;
      private String libroTitulo;
      private String libroTema;
  
      public Libro()
      {}
  
      public Libro(int isbn, String autor, String titulo,String tema) 
      {
          this.libroIsbn=isbn;
          this.libroAutor=autor;
          this.libroTitulo=titulo;
          this.libroTema=tema;
      }
  
  
      @Id
      @Column(name = "LIBRO_ISBN", unique = true, nullable = false, precision = 5, scale = 0)
      public int getLibroIsbn() 
      {
          return this.libroIsbn;
      }
  
      public void setLibroIsbn(int isbn) 
      {
          this.libroIsbn=isbn;
      }
  
      @Column(name = "LIBRO_AUTOR", nullable = false, length = 50)
      public String getLibroAutor() 
      {
          return this.libroAutor;
      }
  
      public void setLibroAutor(String autor) {
          this.libroAutor = autor;
      }
  
      @Column(name = "LIBRO_TITULO", nullable = false, length = 50)
      public String getLibroTitulo() 
      {
          return this.libroTitulo;
      }
  
      public void setLibroTitulo(String titulo) {
          this.libroTitulo = titulo;
      }
  
      @Column(name = "LIBRO_TEMA", nullable = false, length = 50)
      public String getLibroTema() 
      {
          return this.libroTema;
      }
  
      public void setLibroTema(String tema) {
          this.libroTema = tema;
      }
  
  //  public String toString() { 
  //      return "Isbn: '" + this.libroIsbn + "' Autor: '" + this.libroAutor + "' Titulo: '" + this.libroTitulo + " 'Tema: '" + this.libroTema + "'";
  //  } 
  
  
  }
  </code></pre>
  
  <p>Class LibroDaoInterface</p>
  
  <pre><code>package com.webservice.serviceDos;
  
  import java.io.Serializable;
  import java.util.List;
  
  
  public interface LibroDaoInterface&lt;T, Id extends Serializable&gt;
  {
      public void persist(T entity);
      public T findById(int id);
      public void delete(T entity);
      public List&lt;T&gt; findAll();
      public void deleteAll();
  
  }
  </code></pre>
  
  <p>LibroDao</p>
  
  <pre><code>package com.webservice.serviceDos;
  
  import java.util.List;
  
  
  import org.hibernate.Session;
  import org.hibernate.SessionFactory;
  import org.hibernate.Transaction;
  import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
  import org.hibernate.cfg.Configuration;
  
  import com.webservice.serviceDos.Libro;
  
  public class LibroDao implements LibroDaoInterface&lt;Libro, String&gt; 
  {
      private Session currentSession;
      private Transaction currentTransaction;
  
      public LibroDao(){}
  
      public Session openCurrentSession()
      {       
          currentSession = getSessionFactory().openSession();
          return currentSession;
      }
  
      public Session OpenCurrentSessionwithTransaction()
      {
          currentSession = getSessionFactory().openSession();
          currentTransaction = currentSession.beginTransaction();
          return currentSession;
      }
  
      public void closeCurrentSession()
      {
          currentSession.close();
      }
  
      public void closeCurrentSessionwithTransaction()
      {
          currentTransaction.commit();
          currentSession.close();
      }
  
      public static SessionFactory getSessionFactory()
      {
          Configuration configuration = new Configuration().configure();
          StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties());
          SessionFactory sessionFactory = configuration.buildSessionFactory(builder.build());
          return sessionFactory;
      }
  
      public Session getCurrentSession()
      {
          return currentSession;
      }
  
      public void setCurrentSession(Session currentSession)
      {
          this.currentSession = currentSession;
      }
  
      public Transaction getSessionTransaction()
      {
          return currentTransaction;
      }
  
      public void setCurrentTransaction(Transaction currentTransaction)
      {
          this.currentTransaction=currentTransaction;
      }
  
      public void persist(Libro entity)
      {
          getCurrentSession().save(entity);
      }
  
      public Libro findById(int id)
      {
          Libro libro = (Libro)getCurrentSession().get(Libro.class, id);
          return libro;
      }
  
      public void delete(Libro entity)
      {
          getCurrentSession().delete(entity);
      }
  
      @SuppressWarnings("unchecked")
      public List&lt;Libro&gt; findAll()
      {
          List&lt;Libro&gt; libros = (List&lt;Libro&gt;)getCurrentSession().createQuery("from libros").list();
          return libros;
      }
  
      public void deleteAll()
      {
          List&lt;Libro&gt; entityList = findAll();
          for(Libro entity : entityList)
          {
              delete(entity);
          }
      }       
  }
  </code></pre>
  
  <p>LibroService</p>
  
  <pre><code>package com.webservice.serviceDos;
  
  import java.util.List;
  
  import com.webservice.serviceDos.Libro;
  import com.webservice.serviceDos.LibroDao;
  
  import org.hibernate.exception.JDBCConnectionException;
  
  public class LibroService 
  {
      public static LibroDao libroDao;
  
      public LibroService()
      {
          libroDao = new LibroDao();
      }
  
      public void persist(Libro entity)
      {
          try
          {
              libroDao.OpenCurrentSessionwithTransaction();
              libroDao.persist(entity);
              libroDao.closeCurrentSessionwithTransaction();
          }
          catch(JDBCConnectionException e)
          {
              System.out.println(e);  
          }
      }
  
      public Libro findById(int id)
      {
          libroDao.openCurrentSession();
          Libro libro = libroDao.findById(id);
          libroDao.closeCurrentSession();
          return libro;
      }
  
      public void delete(int id)
      {
          libroDao.OpenCurrentSessionwithTransaction();
          Libro libro = libroDao.findById(id);
          libroDao.delete(libro);
          libroDao.closeCurrentSessionwithTransaction();
      }
  
      public List&lt;Libro&gt; findAll()
      {
          libroDao.openCurrentSession();
          List&lt;Libro&gt; libros = libroDao.findAll();
          libroDao.closeCurrentSession();
          return libros;
      }
  
      public void deleteAll()
      {
          libroDao.OpenCurrentSessionwithTransaction();
          libroDao.deleteAll();
          libroDao.closeCurrentSessionwithTransaction();
      }
  
      public LibroDao libroDao()
      {
          return libroDao;
      }
  }
  </code></pre>
  
  <p>hibernate.cfg.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;!DOCTYPE hibernate-configuration SYSTEM 
  "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"&gt;
  
  &lt;hibernate-configuration&gt;
      &lt;session-factory&gt;
          &lt;property name="hibernate.dialect"&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;
          &lt;property name="hibernate.connection.driver_class"&gt;com.mysql.jdbc.Driver&lt;/property&gt;
          &lt;property name="hibernate.connection.url"&gt;jdbc:mysql://localhost:3306/biblioteca&lt;/property&gt;
          &lt;property name="hibernate.connection.username"&gt;root&lt;/property&gt;
          &lt;property name="hibernate.connection.password"&gt;1234&lt;/property&gt;
          &lt;property name="hibernate.hmb2dll.auto"&gt;update&lt;/property&gt;
          &lt;property name="show_sql"&gt;true&lt;/property&gt;        
          &lt;property name="hibernate.current_session_context_class"&gt;thread&lt;/property&gt;                
          &lt;mapping class="com.webservice.serviceDos.Libro"/&gt;  
      &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>pom.xml</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
    http://maven.apache.org/xsd/maven.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
    &lt;groupId&gt;com.webservice&lt;/groupId&gt;
    &lt;artifactId&gt;serviceDos&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;jar&lt;/packaging&gt;
  
    &lt;name&gt;serviceDos&lt;/name&gt;
    &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
    &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
    &lt;/properties&gt;
  
    &lt;dependencies&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;junit&lt;/groupId&gt;
        &lt;artifactId&gt;junit&lt;/artifactId&gt;
        &lt;version&gt;3.8.1&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
        &lt;/dependency&gt;
  
        &lt;!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-core --&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
      &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
      &lt;version&gt;4.3.6.Final&lt;/version&gt;
  &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;mysql&lt;/groupId&gt;
              &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
              &lt;version&gt;5.1.6&lt;/version&gt;
          &lt;/dependency&gt;
    &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Error</p>
  
  <pre><code>ago 28, 2016 4:59:16 PM org.hibernate.annotations.common.reflection.java.JavaReflectionManager &lt;clinit&gt;
  INFO: HCANN000001: Hibernate Commons Annotations {4.0.5.Final}
  ago 28, 2016 4:59:16 PM org.hibernate.Version logVersion
  INFO: HHH000412: Hibernate Core {4.3.6.Final}
  ago 28, 2016 4:59:16 PM org.hibernate.cfg.Environment &lt;clinit&gt;
  INFO: HHH000206: hibernate.properties not found
  ago 28, 2016 4:59:16 PM org.hibernate.cfg.Environment buildBytecodeProvider
  INFO: HHH000021: Bytecode provider name : javassist
  ago 28, 2016 4:59:16 PM org.hibernate.cfg.Configuration configure
  INFO: HHH000043: Configuring from resource: /hibernate.cfg.xml
  ago 28, 2016 4:59:16 PM org.hibernate.cfg.Configuration getConfigurationInputStream
  INFO: HHH000040: Configuration resource: /hibernate.cfg.xml
  ago 28, 2016 4:59:16 PM org.hibernate.cfg.Configuration doConfigure
  INFO: HHH000041: Configured SessionFactory: null
  ago 28, 2016 4:59:16 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
  WARN: HHH000402: Using Hibernate built-in connection pool (not for production use!)
  ago 28, 2016 4:59:16 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
  INFO: HHH000401: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql://localhost:3306/biblioteca]
  ago 28, 2016 4:59:16 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
  INFO: HHH000046: Connection properties: {user=root, password=****}
  ago 28, 2016 4:59:16 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator
  INFO: HHH000006: Autocommit mode: false
  ago 28, 2016 4:59:16 PM org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
  INFO: HHH000115: Hibernate connection pool size: 20 (min=1)
  ago 28, 2016 4:59:17 PM org.hibernate.dialect.Dialect &lt;init&gt;
  INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
  ago 28, 2016 4:59:17 PM org.hibernate.engine.jdbc.internal.LobCreatorBuilder useContextualLobCreation
  INFO: HHH000423: Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4
  ago 28, 2016 4:59:17 PM org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateService
  INFO: HHH000399: Using default transaction strategy (direct JDBC transactions)
  ago 28, 2016 4:59:17 PM org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory &lt;init&gt;
  INFO: HHH000397: Using ASTQueryTranslatorFactory
  Exception in thread "main" 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:401)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1857)
      at com.webservice.serviceDos.LibroDao.getSessionFactory(LibroDao.java:49)
      at com.webservice.serviceDos.LibroDao.OpenCurrentSessionwithTransaction(LibroDao.java:29)
      at com.webservice.serviceDos.LibroService.persist(LibroService.java:23)
      at com.webservice.serviceDos.App.main(App.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:403)
      at org.hibernate.persister.entity.AbstractEntityPersister.&lt;init&gt;(AbstractEntityPersister.java:520)
      at org.hibernate.persister.entity.SingleTableEntityPersister.&lt;init&gt;(SingleTableEntityPersister.java:148)
      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: java.lang.NoClassDefFoundError: javassist/util/proxy/MethodFilter
      at org.hibernate.bytecode.internal.javassist.BytecodeProviderImpl.getProxyFactoryFactory(BytecodeProviderImpl.java:58)
      at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactoryInternal(PojoEntityTuplizer.java:244)
      at org.hibernate.tuple.entity.PojoEntityTuplizer.buildProxyFactory(PojoEntityTuplizer.java:222)
      at org.hibernate.tuple.entity.AbstractEntityTuplizer.&lt;init&gt;(AbstractEntityTuplizer.java:212)
      at org.hibernate.tuple.entity.PojoEntityTuplizer.&lt;init&gt;(PojoEntityTuplizer.java:80)
      ... 21 more
  Caused by: java.lang.ClassNotFoundException: javassist.util.proxy.MethodFilter
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      ... 26 more
  </code></pre>