net.sf.hibernate.MappingException: No persister for: java.lang.Integer

Hibernate JIRA | Binyan | 1 decade ago
  1. 0

    I have been trying to map a 3 class relationship where class Person has an integer primary key and has a one-to-many to class Reservation. Class Flight also has an integer primary key and has a one-to-many relationship with class Reservation. Class Reservations has a composite key composed of the primary keys from classes |Person and Flight . This isn't my real code, but my real code has the exact same relationships as described below. Below I describe the example code that is used by the Middlegen-Hibernate-r4 distribution off the hibernate downloads site. -------- -------------- -------- |Person | 1 ---------- * | Reservation | * ------ 1 | Flight | -------- -------------- -------- While hiberate will load the *.hbm.xml files is is not possible to save a Reservation as I get the following stacktrace. The problem relates to the use of the <key-many-to-one/> element in the composite key of the Reservation.hbm.xml. Hibernate: insert into persons (first_name, last_name, person_id) values (?, ?, ?) Hibernate: insert into flights (name, departureUtc, arrivalUtc, flight_id) values (?, ?, ?, ?) Hibernate: insert into reservations (registration_utc, comment, reservation_id, flight_id_fk, person_id_fk) values (?, ?, ?, ?, ?) 12:09:31,515 ERROR SessionImpl:2375 - Could not synchronize database state with session net.sf.hibernate.MappingException: No persister for: java.lang.Integer at net.sf.hibernate.impl.SessionFactoryImpl.getPersister(SessionFactoryImpl.java:344) at net.sf.hibernate.impl.SessionImpl.getClassPersister(SessionImpl.java:2686) at net.sf.hibernate.impl.SessionImpl.getPersister(SessionImpl.java:2693) at net.sf.hibernate.impl.SessionImpl.getEntityIdentifierIfNotUnsaved(SessionImpl.java:2755) at net.sf.hibernate.type.EntityType.getIdentifier(EntityType.java:66) at net.sf.hibernate.type.ManyToOneType.nullSafeSet(ManyToOneType.java:47) at net.sf.hibernate.type.ComponentType.nullSafeSet(ComponentType.java:154) at net.sf.hibernate.persister.EntityPersister.dehydrate(EntityPersister.java:399) at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:466) at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:442) at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:29) at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2414) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2367) at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2236) at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61) at com.trizetto.healthweb.core.internal.model.ReservationTest.testCreateAddress(ReservationTest.java:90) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186) =================================================================== <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" > <hibernate-mapping> <!-- Created by the Middlegen Hibernate plugin http://boss.bekk.no/boss/middlegen/ http://hibernate.sourceforge.net/ --> <class name="airline.hibernate.Reservation" table="reservations" > <composite-id name="comp_id" class="airline.hibernate.ReservationPK"> <key-property name="reservationId" column="reservation_id" type="java.lang.Integer" /> <!-- bi-directional many-to-one association to Flight --> <key-many-to-one name="flight" class="airline.hibernate.Flight" > <column name="flight_id_fk" /> </key-many-to-one> <!-- bi-directional many-to-one association to Person --> <key-many-to-one name="person" class="airline.hibernate.Person" > <column name="person_id_fk" /> </key-many-to-one> </composite-id> <property name="registrationUtc" type="java.sql.Timestamp" column="registration_utc" not-null="true" /> <property name="comment" type="java.lang.String" column="comment" /> <!-- associations --> </class> </hibernate-mapping> ================================================================== <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" > <hibernate-mapping> <!-- Created by the Middlegen Hibernate plugin http://boss.bekk.no/boss/middlegen/ http://hibernate.sourceforge.net/ --> <class name="airline.hibernate.Person" table="persons" > <id name="personId" type="java.lang.Integer" column="person_id" > <generator class="assigned" /> </id> <property name="firstName" type="java.lang.String" column="first_name" not-null="true" /> <property name="lastName" type="java.lang.String" column="last_name" not-null="true" /> <!-- associations --> <!-- bi-directional one-to-many association to Reservation --> <set name="reservations" lazy="true" inverse="true" > <key> <column name="person_id_fk" /> </key> <one-to-many class="airline.hibernate.Reservation" /> </set> </class> </hibernate-mapping> ================================================================== <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" > <hibernate-mapping> <!-- Created by the Middlegen Hibernate plugin http://boss.bekk.no/boss/middlegen/ http://hibernate.sourceforge.net/ --> <class name="airline.hibernate.Flight" table="flights" > <id name="flightId" type="java.lang.Integer" column="flight_id" > <generator class="assigned" /> </id> <property name="name" type="java.lang.String" column="name" not-null="true" length="32" /> <property name="departureUtc" type="java.sql.Timestamp" column="departureUtc" not-null="true" /> <property name="arrivalUtc" type="java.sql.Timestamp" column="arrivalUtc" not-null="true" /> <!-- associations --> <!-- bi-directional one-to-many association to Reservation --> <set name="reservations" lazy="true" inverse="true" > <key> <column name="flight_id_fk" /> </key> <one-to-many class="airline.hibernate.Reservation" /> </set> </class> </hibernate-mapping>

    Hibernate JIRA | 1 decade ago | Binyan
    net.sf.hibernate.MappingException: No persister for: java.lang.Integer
  2. 0

    I have been trying to map a 3 class relationship where class Person has an integer primary key and has a one-to-many to class Reservation. Class Flight also has an integer primary key and has a one-to-many relationship with class Reservation. Class Reservations has a composite key composed of the primary keys from classes |Person and Flight . This isn't my real code, but my real code has the exact same relationships as described below. Below I describe the example code that is used by the Middlegen-Hibernate-r4 distribution off the hibernate downloads site. -------- -------------- -------- |Person | 1 ---------- * | Reservation | * ------ 1 | Flight | -------- -------------- -------- While hiberate will load the *.hbm.xml files is is not possible to save a Reservation as I get the following stacktrace. The problem relates to the use of the <key-many-to-one/> element in the composite key of the Reservation.hbm.xml. Hibernate: insert into persons (first_name, last_name, person_id) values (?, ?, ?) Hibernate: insert into flights (name, departureUtc, arrivalUtc, flight_id) values (?, ?, ?, ?) Hibernate: insert into reservations (registration_utc, comment, reservation_id, flight_id_fk, person_id_fk) values (?, ?, ?, ?, ?) 12:09:31,515 ERROR SessionImpl:2375 - Could not synchronize database state with session net.sf.hibernate.MappingException: No persister for: java.lang.Integer at net.sf.hibernate.impl.SessionFactoryImpl.getPersister(SessionFactoryImpl.java:344) at net.sf.hibernate.impl.SessionImpl.getClassPersister(SessionImpl.java:2686) at net.sf.hibernate.impl.SessionImpl.getPersister(SessionImpl.java:2693) at net.sf.hibernate.impl.SessionImpl.getEntityIdentifierIfNotUnsaved(SessionImpl.java:2755) at net.sf.hibernate.type.EntityType.getIdentifier(EntityType.java:66) at net.sf.hibernate.type.ManyToOneType.nullSafeSet(ManyToOneType.java:47) at net.sf.hibernate.type.ComponentType.nullSafeSet(ComponentType.java:154) at net.sf.hibernate.persister.EntityPersister.dehydrate(EntityPersister.java:399) at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:466) at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:442) at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:29) at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2414) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2367) at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2236) at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61) at com.trizetto.healthweb.core.internal.model.ReservationTest.testCreateAddress(ReservationTest.java:90) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186) =================================================================== <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" > <hibernate-mapping> <!-- Created by the Middlegen Hibernate plugin http://boss.bekk.no/boss/middlegen/ http://hibernate.sourceforge.net/ --> <class name="airline.hibernate.Reservation" table="reservations" > <composite-id name="comp_id" class="airline.hibernate.ReservationPK"> <key-property name="reservationId" column="reservation_id" type="java.lang.Integer" /> <!-- bi-directional many-to-one association to Flight --> <key-many-to-one name="flight" class="airline.hibernate.Flight" > <column name="flight_id_fk" /> </key-many-to-one> <!-- bi-directional many-to-one association to Person --> <key-many-to-one name="person" class="airline.hibernate.Person" > <column name="person_id_fk" /> </key-many-to-one> </composite-id> <property name="registrationUtc" type="java.sql.Timestamp" column="registration_utc" not-null="true" /> <property name="comment" type="java.lang.String" column="comment" /> <!-- associations --> </class> </hibernate-mapping> ================================================================== <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" > <hibernate-mapping> <!-- Created by the Middlegen Hibernate plugin http://boss.bekk.no/boss/middlegen/ http://hibernate.sourceforge.net/ --> <class name="airline.hibernate.Person" table="persons" > <id name="personId" type="java.lang.Integer" column="person_id" > <generator class="assigned" /> </id> <property name="firstName" type="java.lang.String" column="first_name" not-null="true" /> <property name="lastName" type="java.lang.String" column="last_name" not-null="true" /> <!-- associations --> <!-- bi-directional one-to-many association to Reservation --> <set name="reservations" lazy="true" inverse="true" > <key> <column name="person_id_fk" /> </key> <one-to-many class="airline.hibernate.Reservation" /> </set> </class> </hibernate-mapping> ================================================================== <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" > <hibernate-mapping> <!-- Created by the Middlegen Hibernate plugin http://boss.bekk.no/boss/middlegen/ http://hibernate.sourceforge.net/ --> <class name="airline.hibernate.Flight" table="flights" > <id name="flightId" type="java.lang.Integer" column="flight_id" > <generator class="assigned" /> </id> <property name="name" type="java.lang.String" column="name" not-null="true" length="32" /> <property name="departureUtc" type="java.sql.Timestamp" column="departureUtc" not-null="true" /> <property name="arrivalUtc" type="java.sql.Timestamp" column="arrivalUtc" not-null="true" /> <!-- associations --> <!-- bi-directional one-to-many association to Reservation --> <set name="reservations" lazy="true" inverse="true" > <key> <column name="flight_id_fk" /> </key> <one-to-many class="airline.hibernate.Reservation" /> </set> </class> </hibernate-mapping>

    Hibernate JIRA | 1 decade ago | Binyan
    net.sf.hibernate.MappingException: No persister for: java.lang.Integer
  3. 0

    Topic: JRE incompatibility, gives no persister for : java.lang.Long Hi Gavin, Thanks for your reply, i think Hibernate is excellent, i am struggling with this problem whole week, i have tried everything from recompile hibernate to traversing trees but the bug exists whenever i switch from Ibm jre to Sun jre. I don't know where i am making a mistake, here is a recreation of the problem : Classes : "Derivation" is a choice of "Aggregation" or "Formula", which are lists of "Item". "Aggregation" has method attribute of type min or max. "Item" can be a "Constant" or "Operator". DTD is as follows : <!ELEMENT Derivation (Formula | Aggregation)> <!ATTLIST Derivation Type (aggregation | formula) #REQUIRED > <!ELEMENT Aggregation (Item+)> <!ATTLIST Aggregation Method (max | min) #REQUIRED > <!ELEMENT Formula (Item+)> <!ELEMENT Item EMPTY> <!ATTLIST Item Type (constant | operator | reference) #REQUIRED Value CDATA #REQUIRED > Derivation.java : public String getType () //can be aggregation or formula public void setType (String enumValue) public Formula getFormula () public void setFormula (Formula obj) public void setFormula (XmlElement xml) public Aggregation getAggregation () public void setAggregation (Aggregation obj) public void setAggregation (XmlElement xml) Aggregation.java : public String getMethod () //can be max or min public void setMethod (String enumValue) public java.util.List getItem () public void setItem (java.util.List newList) Formula.java public java.util.List getItem () public void setItem (java.util.List newList) Item.java public String getType () //can be constant or operator public void setType (String enumValue) //building session factory Properties prop = new Properties(); prop.load( new FileInputStream("hibernate.properties") ); Configuration cfg = new Configuration(); cfg.addClass(example.Aggregation.class); cfg.addClass(example.Derivation.class); cfg.addClass(example.Formula.class); cfg.addClass(example.Item.class); cfg.setProperties(prop); sessionFactory = cfg.buildSessionFactory(); //main SampleApp sa = new SampleApp(); sa.session = sessionFactory.openSession(); Derivation d = (Derivation) obj; //created this object with sample data shown below sa.session.save(d); sa.session.flush(); sa.session.connection().commit(); sa.session.close(); //sample data <Derivation Type="aggregation"> <Aggregation Method="max"> <Item Type="constant" Value="5"/> <Item Type="constant" Value="24"/> <Item Type="constant" Value="18"/> </Aggregation> </Derivation> //exception i get with Sun 1.3.1_01 or 1.3.1_09 or 1.4.2 versions but not with Ibm jre is 13:59:37,846 DEBUG SessionImpl:413 - opened session 13:59:37,846 DEBUG SessionImpl:656 - saving [example.Derivation#<null>] 13:59:37,846 DEBUG Cascades:336 - processing cascades for: example.Derivation 13:59:37,846 DEBUG Cascades:87 - cascading to saveOrUpdate() net.sf.hibernate.MappingException: No persister for: java.lang.Boolean at net.sf.hibernate.impl.SessionFactoryImpl.getPersister(SessionFactoryImpl.java:420) at net.sf.hibernate.impl.SessionImpl.getPersister(SessionImpl.java:2302) at net.sf.hibernate.impl.SessionImpl.getPersister(SessionImpl.java:2309) at net.sf.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:1195) at net.sf.hibernate.engine.Cascades$4.cascade(Cascades.java:88) at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:258) at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:341) at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:693) at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:605) at example.SampleApp.main(SampleApp.java:89) //Mappings for the above classes are : <hibernate-mapping> <class name="example.Derivation" table="ex_derivation"> <id name="id" type="long" column="id" unsaved-value="0"> <generator class="native"/> </id> <property name="type"/> <many-to-one name="formula" class="example.Formula" column="formula_id" cascade="all"/> <many-to-one name="aggregation" class="example.Aggregation" column="aggregation_id" cascade="all"/> </class> <class name="example.Formula" table="ex_formula"> <id name="id" type="long" column="id" unsaved-value="0"> <generator class="native"/> </id> <list name="item" table="ex_item" cascade="all"> <key column="formula_id"/> <index column="formula_index"/> <one-to-many class="example.Item"/> </list> </class> <class name="example.Aggregation" table="ex_aggregation"> <id name="id" type="long" column="id" unsaved-value="0"> <generator class="native"/> </id> <property name="method"/> <list name="item" table="ex_item" cascade="all"> <key column="aggregation_id"/> <index column="aggregation_index"/> <one-to-many class="example.Item"/> </list> </class> <class name="example.Item" table="ex_item"> <id name="id" type="long" column="id" unsaved-value="0"> <generator class="native"/> </id> <property name="type"/> <property name="value"/> </class> </hibernate-mapping>

    Hibernate JIRA | 1 decade ago | Sunil Reddy
    net.sf.hibernate.MappingException: No persister for: java.lang.Boolean
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Topic: JRE incompatibility, gives no persister for : java.lang.Long Hi Gavin, Thanks for your reply, i think Hibernate is excellent, i am struggling with this problem whole week, i have tried everything from recompile hibernate to traversing trees but the bug exists whenever i switch from Ibm jre to Sun jre. I don't know where i am making a mistake, here is a recreation of the problem : Classes : "Derivation" is a choice of "Aggregation" or "Formula", which are lists of "Item". "Aggregation" has method attribute of type min or max. "Item" can be a "Constant" or "Operator". DTD is as follows : <!ELEMENT Derivation (Formula | Aggregation)> <!ATTLIST Derivation Type (aggregation | formula) #REQUIRED > <!ELEMENT Aggregation (Item+)> <!ATTLIST Aggregation Method (max | min) #REQUIRED > <!ELEMENT Formula (Item+)> <!ELEMENT Item EMPTY> <!ATTLIST Item Type (constant | operator | reference) #REQUIRED Value CDATA #REQUIRED > Derivation.java : public String getType () //can be aggregation or formula public void setType (String enumValue) public Formula getFormula () public void setFormula (Formula obj) public void setFormula (XmlElement xml) public Aggregation getAggregation () public void setAggregation (Aggregation obj) public void setAggregation (XmlElement xml) Aggregation.java : public String getMethod () //can be max or min public void setMethod (String enumValue) public java.util.List getItem () public void setItem (java.util.List newList) Formula.java public java.util.List getItem () public void setItem (java.util.List newList) Item.java public String getType () //can be constant or operator public void setType (String enumValue) //building session factory Properties prop = new Properties(); prop.load( new FileInputStream("hibernate.properties") ); Configuration cfg = new Configuration(); cfg.addClass(example.Aggregation.class); cfg.addClass(example.Derivation.class); cfg.addClass(example.Formula.class); cfg.addClass(example.Item.class); cfg.setProperties(prop); sessionFactory = cfg.buildSessionFactory(); //main SampleApp sa = new SampleApp(); sa.session = sessionFactory.openSession(); Derivation d = (Derivation) obj; //created this object with sample data shown below sa.session.save(d); sa.session.flush(); sa.session.connection().commit(); sa.session.close(); //sample data <Derivation Type="aggregation"> <Aggregation Method="max"> <Item Type="constant" Value="5"/> <Item Type="constant" Value="24"/> <Item Type="constant" Value="18"/> </Aggregation> </Derivation> //exception i get with Sun 1.3.1_01 or 1.3.1_09 or 1.4.2 versions but not with Ibm jre is 13:59:37,846 DEBUG SessionImpl:413 - opened session 13:59:37,846 DEBUG SessionImpl:656 - saving [example.Derivation#<null>] 13:59:37,846 DEBUG Cascades:336 - processing cascades for: example.Derivation 13:59:37,846 DEBUG Cascades:87 - cascading to saveOrUpdate() net.sf.hibernate.MappingException: No persister for: java.lang.Boolean at net.sf.hibernate.impl.SessionFactoryImpl.getPersister(SessionFactoryImpl.java:420) at net.sf.hibernate.impl.SessionImpl.getPersister(SessionImpl.java:2302) at net.sf.hibernate.impl.SessionImpl.getPersister(SessionImpl.java:2309) at net.sf.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:1195) at net.sf.hibernate.engine.Cascades$4.cascade(Cascades.java:88) at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:258) at net.sf.hibernate.engine.Cascades.cascade(Cascades.java:341) at net.sf.hibernate.impl.SessionImpl.doSave(SessionImpl.java:693) at net.sf.hibernate.impl.SessionImpl.save(SessionImpl.java:605) at example.SampleApp.main(SampleApp.java:89) //Mappings for the above classes are : <hibernate-mapping> <class name="example.Derivation" table="ex_derivation"> <id name="id" type="long" column="id" unsaved-value="0"> <generator class="native"/> </id> <property name="type"/> <many-to-one name="formula" class="example.Formula" column="formula_id" cascade="all"/> <many-to-one name="aggregation" class="example.Aggregation" column="aggregation_id" cascade="all"/> </class> <class name="example.Formula" table="ex_formula"> <id name="id" type="long" column="id" unsaved-value="0"> <generator class="native"/> </id> <list name="item" table="ex_item" cascade="all"> <key column="formula_id"/> <index column="formula_index"/> <one-to-many class="example.Item"/> </list> </class> <class name="example.Aggregation" table="ex_aggregation"> <id name="id" type="long" column="id" unsaved-value="0"> <generator class="native"/> </id> <property name="method"/> <list name="item" table="ex_item" cascade="all"> <key column="aggregation_id"/> <index column="aggregation_index"/> <one-to-many class="example.Item"/> </list> </class> <class name="example.Item" table="ex_item"> <id name="id" type="long" column="id" unsaved-value="0"> <generator class="native"/> </id> <property name="type"/> <property name="value"/> </class> </hibernate-mapping>

    Hibernate JIRA | 1 decade ago | Sunil Reddy
    net.sf.hibernate.MappingException: No persister for: java.lang.Boolean
  6. 0

    hibernate persistence

    Stack Overflow | 6 years ago | user726991
    net.sf.hibernate.MappingException: No persister for: fr.hibernate.projet.model.Employe

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. net.sf.hibernate.MappingException

      No persister for: java.lang.Integer

      at net.sf.hibernate.impl.SessionFactoryImpl.getPersister()
    2. net.sf.hibernate
      JDBCTransaction.commit
      1. net.sf.hibernate.impl.SessionFactoryImpl.getPersister(SessionFactoryImpl.java:344)
      2. net.sf.hibernate.impl.SessionImpl.getClassPersister(SessionImpl.java:2686)
      3. net.sf.hibernate.impl.SessionImpl.getPersister(SessionImpl.java:2693)
      4. net.sf.hibernate.impl.SessionImpl.getEntityIdentifierIfNotUnsaved(SessionImpl.java:2755)
      5. net.sf.hibernate.type.EntityType.getIdentifier(EntityType.java:66)
      6. net.sf.hibernate.type.ManyToOneType.nullSafeSet(ManyToOneType.java:47)
      7. net.sf.hibernate.type.ComponentType.nullSafeSet(ComponentType.java:154)
      8. net.sf.hibernate.persister.EntityPersister.dehydrate(EntityPersister.java:399)
      9. net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:466)
      10. net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:442)
      11. net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:29)
      12. net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2414)
      13. net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2367)
      14. net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2236)
      15. net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
      15 frames
    3. com.trizetto.healthweb
      ReservationTest.testCreateAddress
      1. com.trizetto.healthweb.core.internal.model.ReservationTest.testCreateAddress(ReservationTest.java:90)
      1 frame
    4. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:324)
      4 frames
    5. JUnit
      TestSuite.run
      1. junit.framework.TestCase.runTest(TestCase.java:154)
      2. junit.framework.TestCase.runBare(TestCase.java:127)
      3. junit.framework.TestResult$1.protect(TestResult.java:106)
      4. junit.framework.TestResult.runProtected(TestResult.java:124)
      5. junit.framework.TestResult.run(TestResult.java:109)
      6. junit.framework.TestCase.run(TestCase.java:118)
      7. junit.framework.TestSuite.runTest(TestSuite.java:208)
      8. junit.framework.TestSuite.run(TestSuite.java:203)
      8 frames
    6. JUnit3 Runner
      RemoteTestRunner.main
      1. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)
      2. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
      3. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)
      3 frames