java.lang.IllegalStateException: JSR-303 validated property 'earlyCancellation.deadlines[0].penalty.nights' does not have a corresponding accessor for Spring data binding - check your DataBinder's configuration (bean property versus direct field access)

Spring JIRA | Federico Donnarumma | 2 years ago
  1. 0

    Hi, I have this case, when validating with JSR-303. I Have an object which contains an Optional, when SpringValidatorAdapter cycles through properties to show something of the style "you entered 0 but field nights should be higher than 0" BeanWrapper can't access the object inside the Optional and I get this message: {code:java} java.lang.IllegalStateException: JSR-303 validated property 'earlyCancellation.deadlines[0].penalty.nights' does not have a corresponding accessor for Spring data binding - check your DataBinder's configuration (bean property versus direct field access) at org.springframework.validation.beanvalidation.SpringValidatorAdapter.processConstraintViolations(SpringValidatorAdapter.java:158) ~[spring-context-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.validation.beanvalidation.SpringValidatorAdapter.validate(SpringValidatorAdapter.java:107) ~[spring-context-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.validation.DataBinder.validate(DataBinder.java:760) ~[spring-context-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.validate(RequestResponseBodyMethodProcessor.java:123) ~[spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.resolveArgument(RequestResponseBodyMethodProcessor.java:109) ~[spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:79) ~[spring-web-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:157) ~[spring-web-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:124) ~[spring-web-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) ~[spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:781) ~[spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:721) ~[spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83) ~[spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943) ~[spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877) ~[spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) [spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863) [spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) ~[javax.servlet-api-3.1.0.jar:3.1.0] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) [spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.test.web.servlet.TestDispatcherServlet.service(TestDispatcherServlet.java:62) [spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) ~[javax.servlet-api-3.1.0.jar:3.1.0] at org.springframework.mock.web.MockFilterChain$ServletFilterProxy.doFilter(MockFilterChain.java:170) [spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.mock.web.MockFilterChain.doFilter(MockFilterChain.java:137) [spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.test.web.servlet.MockMvc.perform(MockMvc.java:145) [spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE] at com.despegar.bookedia.cancelpolicy.CustomCancelPolicyControllerTest.post_zeroEarlyCancellationNights_okStatus(CustomCancelPolicyControllerTest.java:357) [test-classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_05] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_05] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_05] at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_05] at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) [junit-4.11.jar:na] at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.11.jar:na] at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) [junit-4.11.jar:na] at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) [junit-4.11.jar:na] at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) [junit-4.11.jar:na] at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:72) [spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:81) [spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72) [spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) [junit-4.11.jar:na] at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:216) [spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:82) [spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) [junit-4.11.jar:na] at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) [junit-4.11.jar:na] at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) [junit-4.11.jar:na] at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) [junit-4.11.jar:na] at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) [junit-4.11.jar:na] at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:60) [spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:67) [spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.junit.runners.ParentRunner.run(ParentRunner.java:309) [junit-4.11.jar:na] at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:162) [spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.junit.runner.JUnitCore.run(JUnitCore.java:160) [junit-4.11.jar:na] at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74) [junit-rt.jar:na] at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211) [junit-rt.jar:na] at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67) [junit-rt.jar:na] Caused by: org.springframework.beans.NotReadablePropertyException: Invalid property 'earlyCancellation.deadlines[0]' of bean class [com.despegar.bookedia.cancelpolicy.CancelPolicyDTO]: Bean property 'earlyCancellation.deadlines[0]' 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:705) ~[spring-beans-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.beans.BeanWrapperImpl.getNestedBeanWrapper(BeanWrapperImpl.java:551) ~[spring-beans-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:528) ~[spring-beans-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:529) ~[spring-beans-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:694) ~[spring-beans-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.validation.AbstractPropertyBindingResult.getActualFieldValue(AbstractPropertyBindingResult.java:99) ~[spring-context-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.validation.AbstractBindingResult.getRawFieldValue(AbstractBindingResult.java:283) ~[spring-context-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.validation.beanvalidation.SpringValidatorAdapter.processConstraintViolations(SpringValidatorAdapter.java:143) ~[spring-context-4.1.0.RELEASE.jar:4.1.0.RELEASE] ... 51 common frames omitted {code}

    Spring JIRA | 2 years ago | Federico Donnarumma
    java.lang.IllegalStateException: JSR-303 validated property 'earlyCancellation.deadlines[0].penalty.nights' does not have a corresponding accessor for Spring data binding - check your DataBinder's configuration (bean property versus direct field access)
  2. 0

    Hi, I have this case, when validating with JSR-303. I Have an object which contains an Optional, when SpringValidatorAdapter cycles through properties to show something of the style "you entered 0 but field nights should be higher than 0" BeanWrapper can't access the object inside the Optional and I get this message: {code:java} java.lang.IllegalStateException: JSR-303 validated property 'earlyCancellation.deadlines[0].penalty.nights' does not have a corresponding accessor for Spring data binding - check your DataBinder's configuration (bean property versus direct field access) at org.springframework.validation.beanvalidation.SpringValidatorAdapter.processConstraintViolations(SpringValidatorAdapter.java:158) ~[spring-context-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.validation.beanvalidation.SpringValidatorAdapter.validate(SpringValidatorAdapter.java:107) ~[spring-context-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.validation.DataBinder.validate(DataBinder.java:760) ~[spring-context-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.validate(RequestResponseBodyMethodProcessor.java:123) ~[spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.resolveArgument(RequestResponseBodyMethodProcessor.java:109) ~[spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:79) ~[spring-web-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:157) ~[spring-web-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:124) ~[spring-web-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104) ~[spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:781) ~[spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:721) ~[spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83) ~[spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943) ~[spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877) ~[spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) [spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863) [spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) ~[javax.servlet-api-3.1.0.jar:3.1.0] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) [spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.test.web.servlet.TestDispatcherServlet.service(TestDispatcherServlet.java:62) [spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) ~[javax.servlet-api-3.1.0.jar:3.1.0] at org.springframework.mock.web.MockFilterChain$ServletFilterProxy.doFilter(MockFilterChain.java:170) [spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.mock.web.MockFilterChain.doFilter(MockFilterChain.java:137) [spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.test.web.servlet.MockMvc.perform(MockMvc.java:145) [spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE] at com.despegar.bookedia.cancelpolicy.CustomCancelPolicyControllerTest.post_zeroEarlyCancellationNights_okStatus(CustomCancelPolicyControllerTest.java:357) [test-classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_05] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_05] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_05] at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_05] at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) [junit-4.11.jar:na] at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) [junit-4.11.jar:na] at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) [junit-4.11.jar:na] at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) [junit-4.11.jar:na] at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) [junit-4.11.jar:na] at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:72) [spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:81) [spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72) [spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) [junit-4.11.jar:na] at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:216) [spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:82) [spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) [junit-4.11.jar:na] at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) [junit-4.11.jar:na] at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) [junit-4.11.jar:na] at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) [junit-4.11.jar:na] at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) [junit-4.11.jar:na] at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:60) [spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:67) [spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.junit.runners.ParentRunner.run(ParentRunner.java:309) [junit-4.11.jar:na] at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:162) [spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.junit.runner.JUnitCore.run(JUnitCore.java:160) [junit-4.11.jar:na] at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74) [junit-rt.jar:na] at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211) [junit-rt.jar:na] at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67) [junit-rt.jar:na] Caused by: org.springframework.beans.NotReadablePropertyException: Invalid property 'earlyCancellation.deadlines[0]' of bean class [com.despegar.bookedia.cancelpolicy.CancelPolicyDTO]: Bean property 'earlyCancellation.deadlines[0]' 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:705) ~[spring-beans-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.beans.BeanWrapperImpl.getNestedBeanWrapper(BeanWrapperImpl.java:551) ~[spring-beans-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:528) ~[spring-beans-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:529) ~[spring-beans-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:694) ~[spring-beans-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.validation.AbstractPropertyBindingResult.getActualFieldValue(AbstractPropertyBindingResult.java:99) ~[spring-context-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.validation.AbstractBindingResult.getRawFieldValue(AbstractBindingResult.java:283) ~[spring-context-4.1.0.RELEASE.jar:4.1.0.RELEASE] at org.springframework.validation.beanvalidation.SpringValidatorAdapter.processConstraintViolations(SpringValidatorAdapter.java:143) ~[spring-context-4.1.0.RELEASE.jar:4.1.0.RELEASE] ... 51 common frames omitted {code}

    Spring JIRA | 2 years ago | Federico Donnarumma
    java.lang.IllegalStateException: JSR-303 validated property 'earlyCancellation.deadlines[0].penalty.nights' does not have a corresponding accessor for Spring data binding - check your DataBinder's configuration (bean property versus direct field access)
  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 'earlyCancellation.deadlines[0]' of bean class [com.despegar.bookedia.cancelpolicy.CancelPolicyDTO]: Bean property 'earlyCancellation.deadlines[0]' 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:705)[spring-beans-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    2. org.springframework.beans.BeanWrapperImpl.getNestedBeanWrapper(BeanWrapperImpl.java:551)[spring-beans-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    3. org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:528)[spring-beans-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    4. org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:529)[spring-beans-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    5. org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:694)[spring-beans-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    5 frames
  3. Spring Context
    DataBinder.validate
    1. org.springframework.validation.AbstractPropertyBindingResult.getActualFieldValue(AbstractPropertyBindingResult.java:99)[spring-context-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    2. org.springframework.validation.AbstractBindingResult.getRawFieldValue(AbstractBindingResult.java:283)[spring-context-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    3. org.springframework.validation.beanvalidation.SpringValidatorAdapter.processConstraintViolations(SpringValidatorAdapter.java:143)[spring-context-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    4. org.springframework.validation.beanvalidation.SpringValidatorAdapter.validate(SpringValidatorAdapter.java:107)[spring-context-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    5. org.springframework.validation.DataBinder.validate(DataBinder.java:760)[spring-context-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    5 frames
  4. Spring MVC
    RequestResponseBodyMethodProcessor.resolveArgument
    1. org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.validate(RequestResponseBodyMethodProcessor.java:123)[spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    2. org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.resolveArgument(RequestResponseBodyMethodProcessor.java:109)[spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    2 frames
  5. Spring
    InvocableHandlerMethod.invokeForRequest
    1. org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:79)[spring-web-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    2. org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:157)[spring-web-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    3. org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:124)[spring-web-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    3 frames
  6. Spring MVC
    FrameworkServlet.doPost
    1. org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)[spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    2. org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:781)[spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    3. org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:721)[spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    4. org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:83)[spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    5. org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943)[spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    6. org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)[spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    7. org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)[spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    8. org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863)[spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    8 frames
  7. JavaServlet
    HttpServlet.service
    1. javax.servlet.http.HttpServlet.service(HttpServlet.java:707)[javax.servlet-api-3.1.0.jar:3.1.0]
    1 frame
  8. Spring MVC
    FrameworkServlet.service
    1. org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)[spring-webmvc-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    1 frame
  9. Spring TestContext
    TestDispatcherServlet.service
    1. org.springframework.test.web.servlet.TestDispatcherServlet.service(TestDispatcherServlet.java:62)[spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    1 frame
  10. JavaServlet
    HttpServlet.service
    1. javax.servlet.http.HttpServlet.service(HttpServlet.java:790)[javax.servlet-api-3.1.0.jar:3.1.0]
    1 frame
  11. Spring TestContext
    MockMvc.perform
    1. org.springframework.mock.web.MockFilterChain$ServletFilterProxy.doFilter(MockFilterChain.java:170)[spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    2. org.springframework.mock.web.MockFilterChain.doFilter(MockFilterChain.java:137)[spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    3. org.springframework.test.web.servlet.MockMvc.perform(MockMvc.java:145)[spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    3 frames
  12. com.despegar.bookedia
    CustomCancelPolicyControllerTest.post_zeroEarlyCancellationNights_okStatus
    1. com.despegar.bookedia.cancelpolicy.CustomCancelPolicyControllerTest.post_zeroEarlyCancellationNights_okStatus(CustomCancelPolicyControllerTest.java:357)[test-classes/:na]
    1 frame
  13. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_05]
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[na:1.8.0_05]
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_05]
    4. java.lang.reflect.Method.invoke(Method.java:483)[na:1.8.0_05]
    4 frames
  14. JUnit
    RunBefores.evaluate
    1. org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)[junit-4.11.jar:na]
    2. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)[junit-4.11.jar:na]
    3. org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)[junit-4.11.jar:na]
    4. org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)[junit-4.11.jar:na]
    5. org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)[junit-4.11.jar:na]
    5 frames
  15. Spring TestContext
    SpringRepeat.evaluate
    1. org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:72)[spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    2. org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:81)[spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    3. org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)[spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    3 frames
  16. JUnit
    ParentRunner.runLeaf
    1. org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)[junit-4.11.jar:na]
    1 frame
  17. Spring TestContext
    SpringJUnit4ClassRunner.runChild
    1. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:216)[spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    2. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:82)[spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    2 frames
  18. JUnit
    ParentRunner$2.evaluate
    1. org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)[junit-4.11.jar:na]
    2. org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)[junit-4.11.jar:na]
    3. org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)[junit-4.11.jar:na]
    4. org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)[junit-4.11.jar:na]
    5. org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)[junit-4.11.jar:na]
    5 frames
  19. Spring TestContext
    RunAfterTestClassCallbacks.evaluate
    1. org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:60)[spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    2. org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:67)[spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    2 frames
  20. JUnit
    ParentRunner.run
    1. org.junit.runners.ParentRunner.run(ParentRunner.java:309)[junit-4.11.jar:na]
    1 frame
  21. Spring TestContext
    SpringJUnit4ClassRunner.run
    1. org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:162)[spring-test-4.1.0.RELEASE.jar:4.1.0.RELEASE]
    1 frame
  22. JUnit
    JUnitCore.run
    1. org.junit.runner.JUnitCore.run(JUnitCore.java:160)[junit-4.11.jar:na]
    1 frame
  23. IntelliJ junit4 module
    JUnit4IdeaTestRunner.startRunnerWithArgs
    1. com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)[junit-rt.jar:na]
    1 frame
  24. IDEA
    JUnitStarter.main
    1. com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211)[junit-rt.jar:na]
    2. com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)[junit-rt.jar:na]
    2 frames