net.sf.hibernate.PropertyNotFoundException: Could not find a getter for aEndTerminal in class com.im.Trail

Hibernate JIRA | Sherban Popescu | 1 decade ago
  1. 0

    If one has a variable like: aEndTerminal The getter/setter are generated corectly by the code generator, BUT: Because the getter/setter changes aEndTerminal to AEndTerminal, we got into this later on: net.sf.hibernate.PropertyNotFoundException: Could not find a getter for aEndTerminal in class com.im.Trail at net.sf.hibernate.util.ReflectHelper.getGetter(ReflectHelper.java:206) at net.sf.hibernate.persister.AbstractEntityPersister.<init>(AbstractEntityPersister.java:571) at net.sf.hibernate.persister.EntityPersister.<init>(EntityPersister.java:665) at net.sf.hibernate.persister.PersisterFactory.create(PersisterFactory.java:29) at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:207) at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:627) at com.im.Main.initHibernate(Main.java:42) at com.im.Main.go(Main.java:48) at com.im.Main.main(Main.java:35) Exception in thread "main The problem is Introspector.decapitalize() It has a "special case" that we're hitting, quote from javadoc: " This normally means converting the first character from upper case to lower case, but in the (unusual) special case when there is more than one character and both the first and second characters are upper case, we leave it alone." I've created a copy of Introspector.decapitalize inside ReflectHelper.java without the "special case" , replaced all calls to Introspector.decapitalize with my new 'decapitalize' and all works like a charm. So in my opinion Introspector.decapitalize should not be used in the RelectHelper !!! This kind of bug surfaces when the variable begins with one single lower case character followed by an upper case character !! Thanks, --sherban

    Hibernate JIRA | 1 decade ago | Sherban Popescu
    net.sf.hibernate.PropertyNotFoundException: Could not find a getter for aEndTerminal in class com.im.Trail
  2. 0

    If one has a variable like: aEndTerminal The getter/setter are generated corectly by the code generator, BUT: Because the getter/setter changes aEndTerminal to AEndTerminal, we got into this later on: net.sf.hibernate.PropertyNotFoundException: Could not find a getter for aEndTerminal in class com.im.Trail at net.sf.hibernate.util.ReflectHelper.getGetter(ReflectHelper.java:206) at net.sf.hibernate.persister.AbstractEntityPersister.<init>(AbstractEntityPersister.java:571) at net.sf.hibernate.persister.EntityPersister.<init>(EntityPersister.java:665) at net.sf.hibernate.persister.PersisterFactory.create(PersisterFactory.java:29) at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:207) at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:627) at com.im.Main.initHibernate(Main.java:42) at com.im.Main.go(Main.java:48) at com.im.Main.main(Main.java:35) Exception in thread "main The problem is Introspector.decapitalize() It has a "special case" that we're hitting, quote from javadoc: " This normally means converting the first character from upper case to lower case, but in the (unusual) special case when there is more than one character and both the first and second characters are upper case, we leave it alone." I've created a copy of Introspector.decapitalize inside ReflectHelper.java without the "special case" , replaced all calls to Introspector.decapitalize with my new 'decapitalize' and all works like a charm. So in my opinion Introspector.decapitalize should not be used in the RelectHelper !!! This kind of bug surfaces when the variable begins with one single lower case character followed by an upper case character !! Thanks, --sherban

    Hibernate JIRA | 1 decade ago | Sherban Popescu
    net.sf.hibernate.PropertyNotFoundException: Could not find a getter for aEndTerminal in class com.im.Trail
  3. 0

    PropertyNotFoundException in Hibernate (Object Relational Mapping forum at Coderanch)

    coderanch.com | 7 months ago
    net.sf.hibernate.PropertyNotFoundException: Could not find a getter for deleteInd in class sg.gov.ciris.entity.MtUuidLink
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    dotCMS Users Group - DotCMS isnt starting: Whats wrong?

    dotcms.com | 11 months ago
    db.DotHibernate: Unable to build Session Factory
  6. 0

    Our dataclass has following getters and setters, which looks very JavaBean conform. The problem is the "i" in iCondition. The problem is it is alone there.. private int iCondition; public int getICondition() { return iCondition; } public void setICondition(int iCondition) { this.iCondition = iCondition; } Here is the corresponding mapping: ... <property name="description"/> <property name="ends"/> <property name="iCondition" column="condition"/> <many-to-one name="seller" not-null="true"/> ... The error is: 16:01:04,634 INFO SessionFactoryImpl:119 - building session factory net.sf.hibernate.PropertyNotFoundException: Could not find a getter for iCondition in class org.hibernate.auction.AuctionItem at net.sf.hibernate.property.BasicPropertyAccessor.getGetter(BasicPropertyAccessor.java:182) at net.sf.hibernate.mapping.Property.getGetter(Property.java:175) at net.sf.hibernate.persister.AbstractEntityPersister.<init>(AbstractEntityPersister.java:733) at net.sf.hibernate.persister.EntityPersister.<init>(EntityPersister.java:714) at net.sf.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:42) at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:137) at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:768) at org.hibernate.auction.Main.main(Main.java:419) Exception in thread "main" When I make the property iiCondition and make getters and setters for it, it does work. It seems like the reflection part does work but the concatenating of the "get"+xxxxxx has something wrong in setting the characters to uppercase...

    Hibernate JIRA | 1 decade ago | marcel thiel
    net.sf.hibernate.PropertyNotFoundException: Could not find a getter for iCondition in class org.hibernate.auction.AuctionItem

    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.PropertyNotFoundException

      Could not find a getter for aEndTerminal in class com.im.Trail

      at net.sf.hibernate.util.ReflectHelper.getGetter()
    2. net.sf.hibernate
      Configuration.buildSessionFactory
      1. net.sf.hibernate.util.ReflectHelper.getGetter(ReflectHelper.java:206)
      2. net.sf.hibernate.persister.AbstractEntityPersister.<init>(AbstractEntityPersister.java:571)
      3. net.sf.hibernate.persister.EntityPersister.<init>(EntityPersister.java:665)
      4. net.sf.hibernate.persister.PersisterFactory.create(PersisterFactory.java:29)
      5. net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:207)
      6. net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:627)
      6 frames
    3. com.im
      Main.main
      1. com.im.Main.initHibernate(Main.java:42)
      2. com.im.Main.go(Main.java:48)
      3. com.im.Main.main(Main.java:35)
      3 frames