net.sf.hibernate.PropertyNotFoundException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Hibernate doesnt map the child class
    via Stack Overflow by Anthony_Prog_in
    ,
  • Hi! Section "5.1.5. composite-id" of the "Hibernate Reference Documentation 2.1.3" says that, in a hibernate mapping file, 'composite-id' tag accepts 'access' attribute. I have defined my own PropertyAccessor class and I have used 'access' attribute in my hibernate mapping file, but there is 'PropertyNotFoundException' because hibernate uses 'DirectPropertyAccessor' class and not my PropertyAccessor implementation. This is my hibernate mapping file: --------------------------------------------------------------- <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"><hibernate-mapping><class name='$java.util.HashMap$$EnhancerByCGLIB$$8d83d369' table='maptain_junit_0'><composite-id name='maptainId_0_1_2_3_4_5_6_7_8_9' class='net.sf.maptain.impl.hibernate.Id' access='net.sf.maptain.impl.hibernate.MapCompositeIdAccesor'><key-property name='long' type='long' column='foo_long' access='net.sf.maptain.impl.hibernate.MapKeyPropertyAccesor'/></composite-id><property name='byte' type='byte' column='foo_byte' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/><property name='short' type='short' column='foo_short' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/><property name='integer' type='integer' column='foo_integer' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/><property name='float' type='float' column='foo_float' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/><property name='double' type='double' column='foo_double' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/><property name='boolean' type='boolean' column='foo_boolean' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/><property name='character' type='character' column='foo_character' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/><property name='string' type='string' column='foo_string' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/></class></hibernate-mapping> --------------------------------------------------------------- and this is the exception: --------------------------------------------------------------- net.sf.hibernate.PropertyNotFoundException: field not found: maptainId_0_1_2_3_4_5_6_7_8_9 at net.sf.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:74) at net.sf.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:80) at net.sf.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:80) at net.sf.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:80) at net.sf.hibernate.property.DirectPropertyAccessor.getGetter(DirectPropertyAccessor.java:88) at net.sf.hibernate.util.ReflectHelper.getter(ReflectHelper.java:81) at net.sf.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:90) at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:286) at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1243) at net.sf.hibernate.cfg.Configuration.add(Configuration.java:249) at net.sf.hibernate.cfg.Configuration.addXML(Configuration.java:206) --------------------------------------------------------------- Thankx!
    via by Alfonso da Silva,
  • Hi! Section "5.1.5. composite-id" of the "Hibernate Reference Documentation 2.1.3" says that, in a hibernate mapping file, 'composite-id' tag accepts 'access' attribute. I have defined my own PropertyAccessor class and I have used 'access' attribute in my hibernate mapping file, but there is 'PropertyNotFoundException' because hibernate uses 'DirectPropertyAccessor' class and not my PropertyAccessor implementation. This is my hibernate mapping file: --------------------------------------------------------------- <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"><hibernate-mapping><class name='$java.util.HashMap$$EnhancerByCGLIB$$8d83d369' table='maptain_junit_0'><composite-id name='maptainId_0_1_2_3_4_5_6_7_8_9' class='net.sf.maptain.impl.hibernate.Id' access='net.sf.maptain.impl.hibernate.MapCompositeIdAccesor'><key-property name='long' type='long' column='foo_long' access='net.sf.maptain.impl.hibernate.MapKeyPropertyAccesor'/></composite-id><property name='byte' type='byte' column='foo_byte' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/><property name='short' type='short' column='foo_short' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/><property name='integer' type='integer' column='foo_integer' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/><property name='float' type='float' column='foo_float' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/><property name='double' type='double' column='foo_double' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/><property name='boolean' type='boolean' column='foo_boolean' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/><property name='character' type='character' column='foo_character' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/><property name='string' type='string' column='foo_string' access='net.sf.maptain.impl.hibernate.MapPropertyAccesor'/></class></hibernate-mapping> --------------------------------------------------------------- and this is the exception: --------------------------------------------------------------- net.sf.hibernate.PropertyNotFoundException: field not found: maptainId_0_1_2_3_4_5_6_7_8_9 at net.sf.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:74) at net.sf.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:80) at net.sf.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:80) at net.sf.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:80) at net.sf.hibernate.property.DirectPropertyAccessor.getGetter(DirectPropertyAccessor.java:88) at net.sf.hibernate.util.ReflectHelper.getter(ReflectHelper.java:81) at net.sf.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:90) at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:286) at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1243) at net.sf.hibernate.cfg.Configuration.add(Configuration.java:249) at net.sf.hibernate.cfg.Configuration.addXML(Configuration.java:206) --------------------------------------------------------------- Thankx!
    via by Alfonso da Silva,
    • net.sf.hibernate.PropertyNotFoundException: field not found: transformerId at net.sf.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:74) at net.sf.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:80) at net.sf.hibernate.property.DirectPropertyAccessor.getField(DirectPropertyAccessor.java:80) at net.sf.hibernate.property.DirectPropertyAccessor.getGetter(DirectPropertyAccessor.java:88) at net.sf.hibernate.util.ReflectHelper.getter(ReflectHelper.java:81) at net.sf.hibernate.util.ReflectHelper.reflectedPropertyType(ReflectHelper.java:86) at net.sf.hibernate.mapping.SimpleValue.setTypeByReflection(SimpleValue.java:172)
    No Bugmate found.