Monday, April 2, 2012

org.hibernate.PropertyNotFoundException: Could not find a getter for images in class model.ItemSet


Caused by: org.hibernate.PropertyNotFoundException: Could not find a getter for images in class model.ItemSet
at org.hibernate.property.BasicPropertyAccessor.createGetter(BasicPropertyAccessor.java:326)
at org.hibernate.property.BasicPropertyAccessor.getGetter(BasicPropertyAccessor.java:320)
at org.hibernate.mapping.Property.getGetter(Property.java:304)
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildPropertyGetter(PojoEntityTuplizer.java:297)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:155)
at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:77)
... 15 more

Reason:

Hibernate looks for getImages in the ItemSet class, but it could not find such method or the method is not accessible. The method is not available or the property name declared in the hbm.xml file is wrong.


Solution:

1. Declare the getter method
2. Correct the property name in class and mapping xml
3. Declare getter method using protected access specifier

No comments:

Post a Comment