Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review ExtendedBeanInfo implementation [SPR-8347] #12995

Closed
spring-projects-issues opened this issue May 18, 2011 · 9 comments
Closed

Review ExtendedBeanInfo implementation [SPR-8347] #12995

spring-projects-issues opened this issue May 18, 2011 · 9 comments
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented May 18, 2011

Chris Beams opened SPR-8347 and commented

See #12734 and #12826.

Original commit (and comment) for ExtendedBeanInfo: https://github.com/cbeams/spring-framework/commit/1271acb8eb264f05729ccfa2dc30737c26eeb818

Related commit and comment fixing a small bug with the implementation: https://github.com/cbeams/spring-framework/commit/8dedf111bcf08af967c2de00b3e1ee4e99979533


Affects: 3.1 M1

Issue Links:

  • #13698 Concurrent problem with BeanWrapperImpl.getPropertyValue ("is duplicated by")
  • #12826 ExtendedBeanInfo Passes Empty Property Name to PropertyDescriptor Causing IntrospectionException: bad property name
  • #14663 Overhaul non-void JavaBean write method support
  • #13448 ExtendedBeanInfo raises 'type mismatch' error with covariant property types

Referenced from: commits 4a8be69, 0ee1256, 17cf465

0 votes, 5 watchers

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented 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
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented 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
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented 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
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jan 19, 2012

Benoit de Biolley commented

problem identified :

line 157 and 158 in ExtendedBeanInfo:
hello
if (method == pd.getReadMethod()
|| (pd instanceof IndexedPropertyDescriptor && method == ((IndexedPropertyDescriptor) pd).getIndexedReadMethod())) {
}}
[...]

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jan 19, 2012

Benoit de Biolley commented

you have to use .equals() in place of ==

Kr

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented 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
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jan 23, 2012

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Feb 2, 2012

Chris Beams commented

Resolved in 17cf465

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Nov 25, 2012

Chris Beams commented

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant