-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: exception setting property value with CGLIB
PostPosted: Mon Aug 07, 2006 3:21 am 
Beginner
Beginner

Joined: Wed May 10, 2006 9:43 pm
Posts: 30
Location: Australia
Hi everyone,

I have read a lot of posts about this and would like some more information. Please read on.

I have created a database schema using hibernate, and a another colleague is inserting a large amount of data. When I use the hibernate generated database with test data the data access objects work, when i use the hibernate database with the entire dataset I have the following error:

org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of <package>.<class>.setField1 etc

I noticed:
1- The field name "Field 1" does not belong to the class specified within the package declaration.

2 - When i set hibernate.cglib.use_reflection_optimizer= false within the hibernate.cfg.xml it doesn't give me any extra information and if I block it out it doesn't change anything either. Am i setting this property in the right location??

I assume there is a small difference between the two databases that could be causing the problem. I've been checking to make sure all the types match etc. If you could point me in the right direction as to how to retrieve more information about the error, where the problem is etc or other areas I should be investigating would be appreciated.

Thanks, Alyssa.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 07, 2006 4:58 am 
Expert
Expert

Joined: Tue Dec 07, 2004 6:57 am
Posts: 285
Location: Nürnberg, Germany
Usually this happens if a column is nullable and your property is an int / long / .... (which can't be null) and not an Integer / Long / ....


You have two options:
- change the constraint of the database column to "not null"
- change the types of your class to Integer / Long / ....

_________________
Please don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 08, 2006 12:28 am 
Beginner
Beginner

Joined: Wed May 10, 2006 9:43 pm
Posts: 30
Location: Australia
Thanks for your response!

I've looked into the database and a number of the fields are null.

Changing the types of your class to Integer / Long / ....

Do you mean within the hibernate files, i.e. the class files for each of the tables and the mapping files? I havent specified a type within the mapping files.

Or

Within my data access objects? I have a method to retrieve a record based on an id.

I went through and updated a number of the records to see if it would work (inserting data into the nulls) the number of links to other tables makes it impossible.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.