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: