Hibernate Error : exception setting property value

Been playing around with Hibernate and mapping classes with Java. A reason why Hibernate is useful is so to facilitate users to stop writing pure SQL for queries and reduce code redundancy. A slight note, Hibernate also works well with the .NET platform.

Hibernate Mapping Error

Though there was this error which TechieDan experienced

org.springframework.orm.hibernate3.HibernateSystemException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.biz.domain.product.ProductSubCategory.setIdelivery;

Surprisingly the mistake wasn’t software based. After looking through Hibernate.org websites and other sites for help, it was because of a simple mistake. While creating the field of IDELIVERY into the table, the default value was null, and considering that the IDELIVERY column is integer, it should be defaulted to a default value. So since the column was created earlier with a null value, all that was needed to be done is to update the data in the table to repair this error.

Here’s what I did and it finally is running once again.



  1. zuwairiaiman December 22, 2009
  2. Marcel November 13, 2011
  3. Sravan February 28, 2012

Leave a Reply