All entries for Friday 01 July 2005
July 01, 2005
I hate Hibernate PropertyAccessException!
So I recently changed around some of my hibernate mapping fields around; moving properties from specific subclass to the superclass, and all of a sudden the app broken with the following error:
org.hibernate.PropertyAccessException: could not set a field value by reflection setter of uk.ac.warwick.sbr.BinaryPageImpl.escapeHtml
at
org.hibernate.property.DirectPropertyAccessor$DirectSetter.set(DirectPropertyAccessor.java:81)
This was puzzling because all my unit tests worked, and the setter was definately available.
The problem was that there was a null in the database for the field, for the row I was working on, and it was complaining (correctly) that it cannot set a null against a boolean.
If only the error message had included the value it was trying to set :) Just another example of Hibernates error messages being absolutely correct and entirely unhelpful :)