net.sf.hibernate.MappingException: Unknown entity class: java.lang.Boolean

Hibernate JIRA | Suresh Gopalakrishnan | 9 years ago
  1. 0

    dotCMS Users Group - DotCMS isnt starting: Whats wrong? | 9 months ago
    com.liferay.portal.SystemException: net.sf.hibernate.MappingException: Unknown entity class: com.liferay.portal.ejb.CompanyHBM
  2. Speed up your debug routine!

    Automated exception search integrated into your IDE

  3. 0

    Hibernate Community • View topic - Unknown entity class: java.util.HashSet | 6 months ago
    net.sf.hibernate.MappingException: Unknown entity class: java.util.HashSet
  4. 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 > : 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) : 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) public java.util.List getItem () public void setItem (java.util.List newList) public String getType () //can be constant or operator public void setType (String enumValue) //building session factory Properties prop = new Properties(); prop.load( new FileInputStream("") ); 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.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( at net.sf.hibernate.impl.SessionImpl.getPersister( at net.sf.hibernate.impl.SessionImpl.getPersister( at net.sf.hibernate.impl.SessionImpl.saveOrUpdate( at net.sf.hibernate.engine.Cascades$4.cascade( at net.sf.hibernate.engine.Cascades.cascade( at net.sf.hibernate.engine.Cascades.cascade( at net.sf.hibernate.impl.SessionImpl.doSave( at at example.SampleApp.main( //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

    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

      Unknown entity class: java.lang.Boolean

      at net.sf.hibernate.impl.SessionFactoryImpl.getPersister()
    2. net.sf.hibernate
      1. net.sf.hibernate.impl.SessionFactoryImpl.getPersister(
      2. net.sf.hibernate.impl.SessionImpl.getClassPersister(
      3. net.sf.hibernate.impl.SessionImpl.getPersister(
      4. net.sf.hibernate.impl.SessionImpl.getEntityIdentifierIfNotUnsaved(
      5. net.sf.hibernate.type.EntityType.getIdentifier(
      6. net.sf.hibernate.type.EntityType.isDirty(
      7. net.sf.hibernate.type.TypeFactory.findDirty(
      8. net.sf.hibernate.persister.AbstractEntityPersister.findDirty(
      9. net.sf.hibernate.impl.SessionImpl.flushEntity(
      10. net.sf.hibernate.impl.SessionImpl.flushEntities(
      11. net.sf.hibernate.impl.SessionImpl.flushEverything(
      12. net.sf.hibernate.impl.SessionImpl.flush(
      12 frames
    3. Hibernate
      1. org.springframework.orm.hibernate.HibernateAccessor.flushIfNecessary(
      1 frame