-->
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 Oct 24, 2005 11:53 am 
Newbie

Joined: Mon Oct 03, 2005 9:33 pm
Posts: 2
Hi all, I am using Hibernate 3.0.5 on tomcat5 and trapped by an error of "org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of com.tailorsys.crm.bean.AccountForm.setAddressesList" Please Help!!!

I have two classes AccountForm & Address. Each AccountForm can have corresponding Address up to 4.

The simple AccountForm & Address class are as following:
public final class AccountForm extends ValidatorForm implements Serializable {
private ArrayList addresses = new ArrayList();
//address
public List getAddressesList() {
return addresses;
}


public void setAddressesList(List list) {
addresses = (ArrayList) list;
}


public Address getAddresses(int index) {
while (index >= addresses.size()) {
addresses.add(new Address());
}
return (Address) addresses.get(index);
}


public void setAddresses(int index, Address in) {
if (index >= addresses.size()) {
int i = addresses.size();
do {
addresses.add(new Address());
} while (index >= ++i);
}
addresses.set(index, in);
}
}

Address:
public final class Address implements Serializable {
private long address_id;
public long getAddress_id() {
return address_id;
}
public void setAddress_id(long address_id) {
this.address_id = address_id;
}
}

I am using AccountForm.hbm.xml as following:
<class name="com.tailorsys.crm.bean.AccountForm" table="account">
<id name="ac_id" type="long" unsaved-value="0" >
<column name="account_id" sql-type="bingint(20)" not-null="true"/>
<generator class="increment"/>
</id>
<set name="addressesList" table="accountaddress">
<key column="account_id"/>
<many-to-many column="address_id" class="com.tailorsys.crm.bean.Address"/>
</set>
</class>
<class name="com.tailorsys.crm.bean.Address" table="address">
<id name="address_id" type="long" unsaved-value="0" >
<column name="address_id" sql-type="bingint(20)" not-null="true"/>
<generator class="increment"/>
</id>
</class>
</hibernate-mapping>

Jonathan/eom

Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 24, 2005 12:13 pm 
Beginner
Beginner

Joined: Thu Jun 02, 2005 9:36 am
Posts: 20
In the error, it says:

"set hibernate.cglib.use_reflection_optimizer=false for more info"

Did you do that? Did it give any more information?

Have you tried changing get/setAddressesList to just get/setAddresses()--in other words, remove the List off the end of the method names?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 24, 2005 8:47 pm 
Newbie

Joined: Mon Oct 03, 2005 9:33 pm
Posts: 2
Yes. I did try and the console will show some "SQL" like statement when I execute the program.

By changing the naming convention looks not very promising to try. Correct me if you have something magic behind.

Jonathan/eom

jshellman wrote:
In the error, it says:

"set hibernate.cglib.use_reflection_optimizer=false for more info"

Did you do that? Did it give any more information?

Have you tried changing get/setAddressesList to just get/setAddresses()--in other words, remove the List off the end of the method names?


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.