org.springframework.beans.NotReadablePropertyException: Invalid property 'a' of bean class [SubBean]: Bean property 'a' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?

Spring JIRA | Jim Newsham | 1 decade ago
  1. 0

    I'm attaching a sample test case (you'll need to change the package names from webflow to web.flow to test with PR3). This test case works fine in SWF PR3, and causes an error in the jsp page for SWF PR4 and also the current snapshot of SWF in cvs. The scenario: - A main form submits to a sub form, which collects and validates information and returns to the main form; there is a main flow and a sub flow - The flows use different objects, but the form object names are the same (since flow scope is used, this should be okay, as far as I understand) - If the sub flow returns without doing anything, there is no problem ** If the sub flow performs bindAndValidate before returning, the main form does not set a form object in the request, even when setupForm is first called; this results in an unexpected error on the page when trying to access non-existent fields on the named bean (in PR3, if setupForm is called, all is well, but if setupForm is not called, the same error occurs) In the sample to be attached: - clicking "ok" in the main form, and "cancel" in the subform causes no problem. - clicking "ok" in the main form, and "ok" in the subform causes the following error: org.springframework.beans.NotReadablePropertyException: Invalid property 'a' of bean class [SubBean]: Bean property 'a' 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:652) at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:644) at org.springframework.validation.BindException.getFieldValue(BindException.java:333) at org.springframework.web.servlet.support.BindStatus.<init>(BindStatus.java:117) at org.springframework.web.servlet.tags.BindTag.doStartTagInternal(BindTag.java:115) at org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:68) at _jsp._WEB_22dINF._jsp._main__jsp._jspService(WEB-INF/jsp/main.jsp:11) at com.caucho.jsp.JavaPage.service(JavaPage.java:63) at com.caucho.jsp.Page.pageservice(Page.java:570) at com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:159) at com.caucho.server.webapp.DispatchFilterChain.doFilter(DispatchFilterChain.java:115) at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:208) at com.caucho.server.webapp.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:268) at com.caucho.server.webapp.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:106) at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:97) at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250) at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:928) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:705) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:625) at org.springframework.web.servlet.FrameworkServlet.serviceWrapper(FrameworkServlet.java:386) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:355) at javax.servlet.http.HttpServlet.service(HttpServlet.java:152) at javax.servlet.http.HttpServlet.service(HttpServlet.java:90) at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:99) at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:163) at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:208) at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:259) at com.caucho.server.port.TcpConnection.run(TcpConnection.java:341) at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:490) at com.caucho.util.ThreadPool.run(ThreadPool.java:423) at java.lang.Thread.run(Thread.java:595)

    Spring JIRA | 1 decade ago | Jim Newsham
    org.springframework.beans.NotReadablePropertyException: Invalid property 'a' of bean class [SubBean]: Bean property 'a' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
  2. 0

    I'm attaching a sample test case (you'll need to change the package names from webflow to web.flow to test with PR3). This test case works fine in SWF PR3, and causes an error in the jsp page for SWF PR4 and also the current snapshot of SWF in cvs. The scenario: - A main form submits to a sub form, which collects and validates information and returns to the main form; there is a main flow and a sub flow - The flows use different objects, but the form object names are the same (since flow scope is used, this should be okay, as far as I understand) - If the sub flow returns without doing anything, there is no problem ** If the sub flow performs bindAndValidate before returning, the main form does not set a form object in the request, even when setupForm is first called; this results in an unexpected error on the page when trying to access non-existent fields on the named bean (in PR3, if setupForm is called, all is well, but if setupForm is not called, the same error occurs) In the sample to be attached: - clicking "ok" in the main form, and "cancel" in the subform causes no problem. - clicking "ok" in the main form, and "ok" in the subform causes the following error: org.springframework.beans.NotReadablePropertyException: Invalid property 'a' of bean class [SubBean]: Bean property 'a' 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:652) at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:644) at org.springframework.validation.BindException.getFieldValue(BindException.java:333) at org.springframework.web.servlet.support.BindStatus.<init>(BindStatus.java:117) at org.springframework.web.servlet.tags.BindTag.doStartTagInternal(BindTag.java:115) at org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:68) at _jsp._WEB_22dINF._jsp._main__jsp._jspService(WEB-INF/jsp/main.jsp:11) at com.caucho.jsp.JavaPage.service(JavaPage.java:63) at com.caucho.jsp.Page.pageservice(Page.java:570) at com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:159) at com.caucho.server.webapp.DispatchFilterChain.doFilter(DispatchFilterChain.java:115) at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:208) at com.caucho.server.webapp.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:268) at com.caucho.server.webapp.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:106) at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:97) at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250) at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:928) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:705) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:625) at org.springframework.web.servlet.FrameworkServlet.serviceWrapper(FrameworkServlet.java:386) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:355) at javax.servlet.http.HttpServlet.service(HttpServlet.java:152) at javax.servlet.http.HttpServlet.service(HttpServlet.java:90) at com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:99) at com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:163) at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:208) at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:259) at com.caucho.server.port.TcpConnection.run(TcpConnection.java:341) at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:490) at com.caucho.util.ThreadPool.run(ThreadPool.java:423) at java.lang.Thread.run(Thread.java:595)

    Spring JIRA | 1 decade ago | Jim Newsham
    org.springframework.beans.NotReadablePropertyException: Invalid property 'a' of bean class [SubBean]: Bean property 'a' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
  3. 0

    acess to userName from jsp using spring security

    Stack Overflow | 3 years ago | user2645679
    org.springframework.beans.NotReadablePropertyException: Invalid property 'principal.username' of bean class [org.springframework.security.authentication.UsernamePasswordAuthenticationToken]: Bean property 'principal.username' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    I Keep getting 'NotReadablePropertyException' when running a unit test against a new Spring Validator class

    Stack Overflow | 3 years ago | Sudhir
    org.springframework.beans.NotReadablePropertyException: Invalid property 'login' of bean class [springapp.service.LoginValidator]: Bean property 'login' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
  6. 0

    Create User Exception on Snapshot

    GitHub | 2 years ago | bryanhelmig
    org.springframework.beans.NotReadablePropertyException: Invalid property 'email' of bean class [org.graylog2.restclient.models.api.requests.CreateUserRequestForm]: Bean property 'email' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?

  1. abrazeneb 7 times, last 5 months ago
11 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.springframework.beans.NotReadablePropertyException

    Invalid property 'a' of bean class [SubBean]: Bean property 'a' 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()
  2. Spring Beans
    BeanWrapperImpl.getPropertyValue
    1. org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:652)
    2. org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:644)
    2 frames
  3. Spring Context
    BindException.getFieldValue
    1. org.springframework.validation.BindException.getFieldValue(BindException.java:333)
    1 frame
  4. Spring MVC
    RequestContextAwareTag.doStartTag
    1. org.springframework.web.servlet.support.BindStatus.<init>(BindStatus.java:117)
    2. org.springframework.web.servlet.tags.BindTag.doStartTagInternal(BindTag.java:115)
    3. org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:68)
    3 frames