Skip to content

Review ExtendedBeanInfo implementation [SPR-8347] #12995

Closed

Description

@spring-projects-issues

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:

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

0 votes, 5 watchers

Activity

  1. spring-projects-issues commented on Oct 27, 2011

    @spring-projects-issues
    CollaboratorAuthor

    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

  2. spring-projects-issues commented on Oct 29, 2011

    @spring-projects-issues
    CollaboratorAuthor

    Chris Beams commented

    Thanks, Paul. I've created #13448 in order to address this specific issue. See my comments and questions there.

  3. spring-projects-issues commented on Jan 19, 2012

    @spring-projects-issues
    CollaboratorAuthor

    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

  4. spring-projects-issues commented on Jan 19, 2012

    @spring-projects-issues
    CollaboratorAuthor

    Benoit de Biolley commented

    problem identified :

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

  5. spring-projects-issues commented on Jan 19, 2012

    @spring-projects-issues
    CollaboratorAuthor

    Benoit de Biolley commented

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

    Kr

  6. spring-projects-issues commented on Jan 20, 2012

    @spring-projects-issues
    CollaboratorAuthor

    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

  7. spring-projects-issues commented on Feb 2, 2012

    @spring-projects-issues
    CollaboratorAuthor

    Chris Beams commented

    Resolved in 17cf465

  8. spring-projects-issues commented on Nov 25, 2012

    @spring-projects-issues
    CollaboratorAuthor

    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.

  9. added this to the 3.1.1 milestone on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: task

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions