Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with submit: NullValueInNestedPathException:

 
Alejandro Perez
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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(BeanWrapperImpl.java:453)
at org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:428)
at org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:429)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:645)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:78)
at org.springframework.validation.DataBinder.applyPropertyValues(DataBinder.java:532)
at org.springframework.validation.DataBinder.doBind(DataBinder.java:434)
at org.springframework.web.bind.WebDataBinder.doBind(WebDataBinder.java:147)
at org.springframework.web.bind.ServletRequestDataBinder.bind(ServletRequestDataBinder.java:108)
at org.springframework.web.servlet.mvc.BaseCommandController.bindAndValidate(BaseCommandController.java:391)
at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:263)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:874)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:808)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:441)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at Utiles.UTF8Filter.doFilter(UTF8Filter.java:40)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)

Thanks in advance for any help you can giveme.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic