org.springframework.beans.NullValueInNestedPathException: Invalid property 'homeAddress' of bean class [my.company.web.action.LiteratureFormAction$FormObject]: Value of nested property 'homeAddress' is null

Spring JIRA | Bert Van der Heyden | 9 years ago
  1. 0

    It seems that a Backing Bean (formObject) for a FormAction can't handle nested properties. I have a formObject with 2 references to Address objects (homeAddress and workAddress). They are set to new Address instances via the Constuctor of the formObject. When I debug, I see that the formObject is well instanciated via the createFormObject(context); in the FormAction class. Via Inspect I also saw that both address properties where pointing to Address objects. All very good. But when the view is processed I get this error: org.springframework.beans.NullValueInNestedPathException: Invalid property 'homeAddress' of bean class [my.company.web.action.LiteratureFormAction$FormObject]: Value of nested property 'homeAddress' is null at org.springframework.beans.BeanWrapperImpl.getNestedBeanWrapper(BeanWrapperImpl.java:443) at org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:418) at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:524) at org.springframework.validation.AbstractPropertyBindingResult.getActualFieldValue(AbstractPropertyBindingResult.java:77) at org.springframework.validation.AbstractBindingResult.getFieldValue(AbstractBindingResult.java:337) at org.springframework.validation.BindException.getFieldValue(BindException.java:206) at org.springframework.web.servlet.support.BindStatus.<init>(BindStatus.java:117) at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getBindStatus(AbstractDataBoundFormElementTag.java:179) at org.springframework.web.servlet.tags.form.AbstractHtmlElementTag.resolveCssClass(AbstractHtmlElementTag.java:404) at org.springframework.web.servlet.tags.form.AbstractHtmlElementTag.writeDefaultAttributes(AbstractHtmlElementTag.java:380) at org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag.writeDefaultAttributes(AbstractHtmlInputElementTag.java:177) at org.springframework.web.servlet.tags.form.InputTag.writeTagContent(InputTag.java:139) at org.springframework.web.servlet.tags.form.AbstractFormTag.doStartTagInternal(AbstractFormTag.java:93) at org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:77) at jsp_servlet._pages._requestmaterial.__form._jspService(__form.java:770) at weblogic.servlet.jsp.JspBase.service(JspBase.java:33) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:463) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:70) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:97) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166) at org.acegisecurity.util.FilterChainProxy$VirtualFilter

    Spring JIRA | 9 years ago | Bert Van der Heyden
    org.springframework.beans.NullValueInNestedPathException: Invalid property 'homeAddress' of bean class [my.company.web.action.LiteratureFormAction$FormObject]: Value of nested property 'homeAddress' is null
  2. 0

    It seems that a Backing Bean (formObject) for a FormAction can't handle nested properties. I have a formObject with 2 references to Address objects (homeAddress and workAddress). They are set to new Address instances via the Constuctor of the formObject. When I debug, I see that the formObject is well instanciated via the createFormObject(context); in the FormAction class. Via Inspect I also saw that both address properties where pointing to Address objects. All very good. But when the view is processed I get this error: org.springframework.beans.NullValueInNestedPathException: Invalid property 'homeAddress' of bean class [my.company.web.action.LiteratureFormAction$FormObject]: Value of nested property 'homeAddress' is null at org.springframework.beans.BeanWrapperImpl.getNestedBeanWrapper(BeanWrapperImpl.java:443) at org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:418) at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:524) at org.springframework.validation.AbstractPropertyBindingResult.getActualFieldValue(AbstractPropertyBindingResult.java:77) at org.springframework.validation.AbstractBindingResult.getFieldValue(AbstractBindingResult.java:337) at org.springframework.validation.BindException.getFieldValue(BindException.java:206) at org.springframework.web.servlet.support.BindStatus.<init>(BindStatus.java:117) at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getBindStatus(AbstractDataBoundFormElementTag.java:179) at org.springframework.web.servlet.tags.form.AbstractHtmlElementTag.resolveCssClass(AbstractHtmlElementTag.java:404) at org.springframework.web.servlet.tags.form.AbstractHtmlElementTag.writeDefaultAttributes(AbstractHtmlElementTag.java:380) at org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag.writeDefaultAttributes(AbstractHtmlInputElementTag.java:177) at org.springframework.web.servlet.tags.form.InputTag.writeTagContent(InputTag.java:139) at org.springframework.web.servlet.tags.form.AbstractFormTag.doStartTagInternal(AbstractFormTag.java:93) at org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:77) at jsp_servlet._pages._requestmaterial.__form._jspService(__form.java:770) at weblogic.servlet.jsp.JspBase.service(JspBase.java:33) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:463) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:70) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:97) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166) at org.acegisecurity.util.FilterChainProxy$VirtualFilter

    Spring JIRA | 9 years ago | Bert Van der Heyden
    org.springframework.beans.NullValueInNestedPathException: Invalid property 'homeAddress' of bean class [my.company.web.action.LiteratureFormAction$FormObject]: Value of nested property 'homeAddress' is null
  3. 0

    Spring MVC/Hibernate - NullValueInNestedPathException, Invalid property, value of nested property is null?

    Stack Overflow | 3 years ago | Joshua
    org.springframework.beans.NullValueInNestedPathException: Invalid property 'empCalList[0].shiftAssignmentVO' of bean class [com.safeway.dtr.employee.vo.EmpCalManager]: Value of nested property 'empCalList[0].shiftAssignmentVO' is null
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    I use the following validation rules: {deal: ? not null : 'deal' : 'errors.required.deal' : 101} {deal.client: ? not null : 'deal client' : 'errors.required.deal.client' : 102} I have deal != null and deal.client ==null. The second rule have to find this issue and add error into collection. But, i get the following error: org.springframework.beans.NullValueInNestedPathException: Invalid property 'deal.client' of bean class [com.db.gcf.gbcrm.pipelinedeals.pipelinedeals.web.webflows.actions.PlDealsDealFormBean]: Value of nested property 'deal.client' is null at org.springframework.beans.BeanWrapperImpl.getNestedBeanWrapper(BeanWrapperImpl.java:387) at org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:362) at org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:363) at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:468) at org.springmodules.validation.valang.functions.BeanPropertyFunction.getResult(BeanPropertyFunction.java:59) at org.springmodules.validation.valang.predicates.GenericTestPredicate.evaluate(GenericTestPredicate.java:60) at org.springmodules.validation.valang.predicates.BasicValidationRule.validate(BasicValidationRule.java:124) at org.springmodules.validation.valang.ValangValidator.validate(ValangValidator.java:194) at com.db.gcf.gbcrm.pipelinedeals.pipelinedeals.web.webflows.PlDealsEditValidationTest.testMandatoryFields(PlDealsEditValidationTest.java:36) ... In my opinion you must catch this exception and pass null value into parser. Note, that in general i can't use standalone validator for standalone objects as rules are generally interconnected between objects tree.

    Spring JIRA | 9 years ago | Sergey Ponomarev
    org.springframework.beans.NullValueInNestedPathException: Invalid property 'deal.client' of bean class [com.db.gcf.gbcrm.pipelinedeals.pipelinedeals.web.webflows.actions.PlDealsDealFormBean]: Value of nested property 'deal.client' is null
  6. 0

    I use the following validation rules: {deal: ? not null : 'deal' : 'errors.required.deal' : 101} {deal.client: ? not null : 'deal client' : 'errors.required.deal.client' : 102} I have deal != null and deal.client ==null. The second rule have to find this issue and add error into collection. But, i get the following error: org.springframework.beans.NullValueInNestedPathException: Invalid property 'deal.client' of bean class [com.db.gcf.gbcrm.pipelinedeals.pipelinedeals.web.webflows.actions.PlDealsDealFormBean]: Value of nested property 'deal.client' is null at org.springframework.beans.BeanWrapperImpl.getNestedBeanWrapper(BeanWrapperImpl.java:387) at org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:362) at org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:363) at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:468) at org.springmodules.validation.valang.functions.BeanPropertyFunction.getResult(BeanPropertyFunction.java:59) at org.springmodules.validation.valang.predicates.GenericTestPredicate.evaluate(GenericTestPredicate.java:60) at org.springmodules.validation.valang.predicates.BasicValidationRule.validate(BasicValidationRule.java:124) at org.springmodules.validation.valang.ValangValidator.validate(ValangValidator.java:194) at com.db.gcf.gbcrm.pipelinedeals.pipelinedeals.web.webflows.PlDealsEditValidationTest.testMandatoryFields(PlDealsEditValidationTest.java:36) ... In my opinion you must catch this exception and pass null value into parser. Note, that in general i can't use standalone validator for standalone objects as rules are generally interconnected between objects tree.

    Spring JIRA | 9 years ago | Sergey Ponomarev
    org.springframework.beans.NullValueInNestedPathException: Invalid property 'deal.client' of bean class [com.db.gcf.gbcrm.pipelinedeals.pipelinedeals.web.webflows.actions.PlDealsDealFormBean]: Value of nested property 'deal.client' is null

    1 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.NullValueInNestedPathException

      Invalid property 'homeAddress' of bean class [my.company.web.action.LiteratureFormAction$FormObject]: Value of nested property 'homeAddress' is null

      at org.springframework.beans.BeanWrapperImpl.getNestedBeanWrapper()
    2. Spring Beans
      BeanWrapperImpl.getPropertyValue
      1. org.springframework.beans.BeanWrapperImpl.getNestedBeanWrapper(BeanWrapperImpl.java:443)
      2. org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:418)
      3. org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:524)
      3 frames
    3. Spring Context
      BindException.getFieldValue
      1. org.springframework.validation.AbstractPropertyBindingResult.getActualFieldValue(AbstractPropertyBindingResult.java:77)
      2. org.springframework.validation.AbstractBindingResult.getFieldValue(AbstractBindingResult.java:337)
      3. org.springframework.validation.BindException.getFieldValue(BindException.java:206)
      3 frames
    4. Spring MVC
      RequestContextAwareTag.doStartTag
      1. org.springframework.web.servlet.support.BindStatus.<init>(BindStatus.java:117)
      2. org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getBindStatus(AbstractDataBoundFormElementTag.java:179)
      3. org.springframework.web.servlet.tags.form.AbstractHtmlElementTag.resolveCssClass(AbstractHtmlElementTag.java:404)
      4. org.springframework.web.servlet.tags.form.AbstractHtmlElementTag.writeDefaultAttributes(AbstractHtmlElementTag.java:380)
      5. org.springframework.web.servlet.tags.form.AbstractHtmlInputElementTag.writeDefaultAttributes(AbstractHtmlInputElementTag.java:177)
      6. org.springframework.web.servlet.tags.form.InputTag.writeTagContent(InputTag.java:139)
      7. org.springframework.web.servlet.tags.form.AbstractFormTag.doStartTagInternal(AbstractFormTag.java:93)
      8. org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:77)
      8 frames
    5. jsp_servlet._pages._requestmaterial
      __form._jspService
      1. jsp_servlet._pages._requestmaterial.__form._jspService(__form.java:770)
      1 frame
    6. weblogic.servlet.jsp
      JspBase.service
      1. weblogic.servlet.jsp.JspBase.service(JspBase.java:33)
      1 frame
    7. Atmosphere weblogic
      FilterChainImpl.doFilter
      1. weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)
      2. weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
      3. weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:463)
      4. weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
      5. weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
      5 frames
    8. Acegi Security Core
      FilterChainProxy$VirtualFilterChain.doFilter
      1. org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
      1 frame
    9. Spring
      OncePerRequestFilter.doFilter
      1. org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:70)
      1 frame
    10. Acegi Security Core
      ExceptionTranslationFilter.doFilter
      1. org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      2. org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:97)
      3. org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
      4. org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
      5. org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166)
      5 frames