Sunday, March 7, 2010

Not Writable or Invalid Setter Method Exception :


org.springframework.beans.NotWritablePropertyException: Invalid property 'xxxxxx' of bean class [com.company.springhibernateintegration.classes.AddressDAOImpl]: Bean property 'hibernateTemplate' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

Two reasons for occuring this exception is :
  1. When the property is not specified in the bean and is mentioned in the bean registration in the application-context.xml
  2. When you are trying to insert the 'xxxxx' property into the bean through a STATIC Setter.