Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

problem with submit: NullValueInNestedPathException:

Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I have a SimpleFormController and a jsp view in which i use <spring: nestedPath> and <spring:bindPath> I save finally the command with hibernate. Everything is ok when I modify an object previosly stored, I retrieve it from database and returned in the formBackingObject, but when i have to save a completely new object i got a NullValueInNestedPathException when I submmit.
The Object is composed by properties and another object which is composed by properties and another object, this lastone is always retrieved for database and must be updated if required when i save the command.
The form is correctly displayed whith the data of the last object that can be modified but when i submit i got the exception telling that this last object is null.

here the code of controller:

the jsp view

trace of the exception

22/04/2010 04:34:47 PM org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: Servlet.service() para servlet springmvc lanzó excepción
org.springframework.beans.NullValueInNestedPathException: Invalid property 'examen.sujeto' of bean class [mapping.CuestionarioInicial]: Value of nested property 'examen.sujeto' is null
at org.springframework.beans.BeanWrapperImpl.getNestedBeanWrapper(
at org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(
at org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(
at org.springframework.validation.DataBinder.applyPropertyValues(
at org.springframework.validation.DataBinder.doBind(
at org.springframework.web.bind.WebDataBinder.doBind(
at org.springframework.web.bind.ServletRequestDataBinder.bind(
at org.springframework.web.servlet.mvc.BaseCommandController.bindAndValidate(
at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(
at org.springframework.web.servlet.DispatcherServlet.doDispatch(
at org.springframework.web.servlet.DispatcherServlet.doService(
at org.springframework.web.servlet.FrameworkServlet.processRequest(
at org.springframework.web.servlet.FrameworkServlet.doPost(
at javax.servlet.http.HttpServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.springframework.web.filter.OncePerRequestFilter.doFilter(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at Utiles.UTF8Filter.doFilter(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.Http11Processor.process(
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
at Source)

Thanks in advance for any help you can giveme.
this is supposed to be a surprise, but it smells like a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic