Home » Java

Hibernate Error : exception setting property value

Written By: techieDan on December 17, 2009 3 Comments

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.tm.ccpm.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.

update TABLENAME set IDELIVERY = 0;

Related Posts with Thumbnails

Tags: , , ,

Digg this!Add to del.icio.us!Stumble this!Add to Techorati!Share on Facebook!Seed Newsvine!Reddit!Add to Yahoo!

3 Responses to “Hibernate Error : exception setting property value”

  1. zuwairiaiman says on: 22 December 2009 at 4:30 pm

    wow.. you are good in what you do

  2. Marcel says on: 13 November 2011 at 12:14 am

    Right on the money , i was about to go insane with this error. you rock ,man !!!! Thank you very much

  3. Sravan says on: 28 February 2012 at 2:43 pm

    Hi,
    I Struggled with the above Error your solution works for me .
    Thanks very much
    Thank you,

Leave a Reply:

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  Copyright © 2009 TechieDan, All rights reserved.| Powered by WordPress