In the Bean Definition Inheritance example in the reference docs, when I used instance code, an error occurred.
Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'age' of bean class [org.springframework.beans.DerivedTestBean]: Bean property 'age' is not writable or has an invalid setter method. Did you mean 'name'?
The age's setter method is consistent with the configuration.
When I comment out the age attribute, it runs successfully.
Comment From: sbrannen
For the example to work, DerivedTestBean
either needs to extend TestBean
, or they need to both have compatible name
and age
JavaBean properties.
I assume your implementations of DerivedTestBean
and TestBean
do not adhere to that.
For working example types, see the corresponding classes in this package in our test suite.
In light of that, I am closing this issue.
Comment From: izeye
This seems to have been meant to be closed.