You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am experienceing an issue with ExtendedBeanInfo and covarianet propertytypes i've yet to isolate a simple test but it appears to be due using JDK PropertyDescriptor and the long standing JDK bug that are the cause resulting in
java.beans.IntrospectionException: type mismatch between read and write methods
at java.beans.PropertyDescriptor.findPropertyType(PropertyDescriptor.java:603)
at java.beans.PropertyDescriptor.setWriteMethod(PropertyDescriptor.java:270)
at java.beans.PropertyDescriptor.<init>(PropertyDescriptor.java:117)
at org.springframework.beans.ExtendedBeanInfo.addOrUpdatePropertyDescriptor(ExtendedBeanInfo.java:260)
at org.springframework.beans.ExtendedBeanInfo.addOrUpdatePropertyDescriptor(ExtendedBeanInfo.java:178)
at org.springframework.beans.ExtendedBeanInfo.<init>(ExtendedBeanInfo.java:95)
at org.springframework.beans.CachedIntrospectionResults.<init>(CachedIntrospectionResults.java:224)
... 124 more
I had the same problem on Mac OS X (jdk 6) :
org.springframework.beans.NotReadablePropertyException: Invalid property 'principal' of bean class [org.springframework.security.authentication.UsernamePasswordAuthenticationToken]: Bean property 'principal' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:729)
at org.springframework.beans.BeanWrapperImpl.getNestedBeanWrapper(BeanWrapperImpl.java:576)
at org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:553)
at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:719)
at org.springframework.security.taglibs.authz.AuthenticationTag.doEndTag(AuthenticationTag.java:101)
Patching ExtendedBeanInfo the way Benoit explained did fix the problem.
A general note to watchers of ExtendedBeanInfo-related issues: #14663 is a major refactoring of ExtendedBeanInfo and overall support for non-void returning setter methods.
If you have submitted a reproduction project with this issue, we have run it through its paces against these new changes, but we would like to ask you to do the same against your actual applications.
Please consider updating your dev or test builds to work against 3.1.4.BUILD-SNAPSHOT and/or 3.2.0.BUILD-SNAPSHOT to verify, and we would appreciate any feedback, even if it's to let us know that all is well. So that we can consolidate feedback, please add your comments to #14663, and mention the original issue(s) that you were watching.
Thanks!
Note also that testing against 3.1.4 is preferable to 3.2.0 because ExtendedBeanInfo is always in the code path in the latter, while in 3.2.0 we've optimized things such that ExtendedBeanInfo is only in play for bean classes that have one or more non-void returning setter methods.
Activity
spring-projects-issues commentedon Oct 27, 2011
Paul Nardone commented
I am experienceing an issue with ExtendedBeanInfo and covarianet propertytypes i've yet to isolate a simple test but it appears to be due using JDK PropertyDescriptor and the long standing JDK bug that are the cause resulting in
java.beans.IntrospectionException: type mismatch between read and write methods
at java.beans.PropertyDescriptor.findPropertyType(PropertyDescriptor.java:603)
at java.beans.PropertyDescriptor.setWriteMethod(PropertyDescriptor.java:270)
at java.beans.PropertyDescriptor.<init>(PropertyDescriptor.java:117)
at org.springframework.beans.ExtendedBeanInfo.addOrUpdatePropertyDescriptor(ExtendedBeanInfo.java:260)
at org.springframework.beans.ExtendedBeanInfo.addOrUpdatePropertyDescriptor(ExtendedBeanInfo.java:178)
at org.springframework.beans.ExtendedBeanInfo.<init>(ExtendedBeanInfo.java:95)
at org.springframework.beans.CachedIntrospectionResults.<init>(CachedIntrospectionResults.java:224)
... 124 more
spring-projects-issues commentedon Oct 29, 2011
Chris Beams commented
Thanks, Paul. I've created #13448 in order to address this specific issue. See my comments and questions there.
spring-projects-issues commentedon Jan 19, 2012
Benoit de Biolley commented
Just find an issue with websphere application server 7,
For some reasons on our was 7.0 in dev (full version)
ExtendedBeanInfo is removing all property descriptors.
that don't have a setter.
Issue not realy identified because on the was on our local machine (express version)
we dont have this issue.
link to my stack overflow post for a tempory solution (reverting to previous version of CachedIntrospectionResults) : http://stackoverflow.com/questions/8849042/beanwrapperimpl-issues-only-with-websphere
spring-projects-issues commentedon Jan 19, 2012
Benoit de Biolley commented
problem identified :
line 157 and 158 in ExtendedBeanInfo:
helloif (method == pd.getReadMethod()
|| (pd instanceof IndexedPropertyDescriptor && method == ((IndexedPropertyDescriptor) pd).getIndexedReadMethod())) {
}}
[...]
spring-projects-issues commentedon Jan 19, 2012
Benoit de Biolley commented
you have to use .equals() in place of ==
Kr
spring-projects-issues commentedon Jan 20, 2012
Stéphane Landelle commented
Hi,
I had the same problem on Mac OS X (jdk 6) :
org.springframework.beans.NotReadablePropertyException: Invalid property 'principal' of bean class [org.springframework.security.authentication.UsernamePasswordAuthenticationToken]: Bean property 'principal' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:729)
at org.springframework.beans.BeanWrapperImpl.getNestedBeanWrapper(BeanWrapperImpl.java:576)
at org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:553)
at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:719)
at org.springframework.security.taglibs.authz.AuthenticationTag.doEndTag(AuthenticationTag.java:101)
Patching ExtendedBeanInfo the way Benoit explained did fix the problem.
Steph
spring-projects-issues commentedon Jan 23, 2012
Benoit de Biolley commented
pull request:
https://github.com/SpringSource/spring-framework/pull/20/commits
spring-projects-issues commentedon Feb 2, 2012
Chris Beams commented
Resolved in 17cf465
spring-projects-issues commentedon Nov 25, 2012
Chris Beams commented
A general note to watchers of
ExtendedBeanInfo-related issues: #14663 is a major refactoring ofExtendedBeanInfoand overall support for non-void returning setter methods.If you have submitted a reproduction project with this issue, we have run it through its paces against these new changes, but we would like to ask you to do the same against your actual applications.
Please consider updating your dev or test builds to work against 3.1.4.BUILD-SNAPSHOT and/or 3.2.0.BUILD-SNAPSHOT to verify, and we would appreciate any feedback, even if it's to let us know that all is well. So that we can consolidate feedback, please add your comments to #14663, and mention the original issue(s) that you were watching.
Thanks!
Note also that testing against 3.1.4 is preferable to 3.2.0 because
ExtendedBeanInfois always in the code path in the latter, while in 3.2.0 we've optimized things such thatExtendedBeanInfois only in play for bean classes that have one or more non-void returning setter methods.