Hi all.
I’m trying to map a POJO in hibernate and everything works fine. One of the mapped attributes is a boolean. It works.
The problem starts when I add another boolean field. When I update the xxx.hbm.xml and re-launch the application I get this error message:
Quote:
org.springframework.orm.hibernate3.HibernateSystemException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of contactos.negocio.Contacto.setContactado; nested exception is org.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of contactos.negocio.Contacto.setContactado
The model object setter exists and is correct, the database table is also correct.
This error has no sense to me. Why works for first one, and not for the other? I have read the code a lot of times and I can’t understand this error.
Here is the code:
Mapping file: contacto.hbm.xml:
Code:
…
<property name="afiliado" type="boolean" /> <!-- works ->
<property name="contactado" type="boolean" /> <!-- fails ->
…
Model object: contactos.negocio.Contacto
Code:
…
private boolean afiliado;
private boolean contactado;
public boolean isAfiliado() {
return afiliado;
}
public boolean isContactado() {
return contactado;
}
public void setAfiliado(boolean afiliado) {
this.afiliado = afiliado;
}
public void setContactado(boolean contactado) {
this.contactado = contactado;
}
…
Any idea of what is wrong?
Thanks in advance
Extra info:
INFO - CGLIB2 available: proxyTargetClass feature enabled
INFO - Hibernate 3.1.2
INFO - using CGLIB reflection optimizer
INFO - RDBMS: PostgreSQL, version: 7.4.8
INFO - JDBC driver: PostgreSQL Native Driver, version: PostgreSQL 7.4 JDBC3 with SSL (build 210)
INFO - Using dialect: org.hibernate.dialect.PostgreSQLDialect