From: <leg...@at...> - 2003-11-01 00:32:14
|
Message: The following issue has been closed. Resolver: Gavin King Date: Fri, 31 Oct 2003 6:31 PM This occurs because your get/set pair is overloaded, and diff JVMs return reflected methods in diff orders. Hibernate does not support overloaded get/set pairs. If it is a problem consider using access="direct" in 2.1. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-443 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-443 Summary: JRE incompatibility, gives no persister for : java.lang.Boolean Type: Bug Status: Closed Priority: Critical Resolution: WON'T FIX Project: Hibernate2 Versions: 2.0.3 Assignee: Reporter: Sunil Reddy Created: Fri, 31 Oct 2003 1:26 PM Updated: Fri, 31 Oct 2003 6:31 PM Environment: Windows 2000, going against DB2 7.0, Hibernate 2.0.3, Websphere 5.0, Sun JDK 1.3.1_01. Description: 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> --------------------------------------------------------------------- JIRA INFORMATION: This message is automatically generated by JIRA. If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |