Announcement Announcement Module
Collapse
No announcement yet.
Handling InvalidPropertyException during page reload Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Handling InvalidPropertyException during page reload

    I have a view/jsp in which the user is enabled to add and remove links.
    It all works fine unless I have removed the last link and the user presses F5 or the reload button/symbol of the browser. This ends up in an InvalidPropertyException:
    Code:
    Invalid property 'processes[0].deliverables[0].dmsLinks[1]' of bean class [DataProcess] : Index out of bounds in property path 'dmsLinks[1]'; nested exception is java.lang.IndexOutOfBoundsException: Index:1, Size:1
    So, where is the place in the workflow to catch the request and check, if the page has been reloaded sending the previous request (query string)?
    Knowing this, I could check that the indices are within an arrays bounds and act accordingly.

    Thank you,
    Dirk

  • #2
    Is this in a Spring Web Flow powered application?
    Could you post the complete stack trace so that we have more of an idea of where exactly the exception occurs?

    Erwin

    Comment


    • #3
      Well, you're right. It's no Spring Web Flow powerde application. I think this thread should be posted in "Spring Framework Support Forums > Core Spring & Sub Projects > Web". I'm sorry. I hope you could help me anyway.

      To remember:
      I deleted the last item in the collection and afterwards I push the reload button. This causes sending the request once more which ends up in the following exception.

      Here's the stack trace:

      Code:
      [checklist] 2007-02-09 17:33:52,002 ERROR - org.apache.catalina.core.StandardWrapperValve.invoke(253) | Servlet.service() for servlet ChecklistApp threw exception
      org.springframework.beans.InvalidPropertyException: Invalid property 'processes[0].deliverables[0].dmsLinks[0]' of bean class [checklist.model.DataProcess]: Index of out of bounds in property path 'dmsLinks[0]'; nested exception is java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
      java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
      	at java.util.ArrayList.RangeCheck(ArrayList.java:546)
      	at java.util.ArrayList.get(ArrayList.java:321)
      	at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:511)
      	at org.springframework.beans.BeanWrapperImpl.getNestedBeanWrapper(BeanWrapperImpl.java:392)
      	at org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:369)
      	at org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:370)
      	at org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(BeanWrapperImpl.java:370)
      	at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:565)
      	at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:737)
      	at org.springframework.beans.BeanWrapperImpl.setPropertyValues(BeanWrapperImpl.java:764)
      	at org.springframework.validation.DataBinder.applyPropertyValues(DataBinder.java:418)
      	at org.springframework.validation.DataBinder.doBind(DataBinder.java:325)
      	at org.springframework.web.bind.WebDataBinder.doBind(WebDataBinder.java:122)
      	at org.springframework.web.bind.ServletRequestDataBinder.bind(ServletRequestDataBinder.java:131)
      	at org.springframework.web.servlet.mvc.BaseCommandController.bindAndValidate(BaseCommandController.java:368)
      	at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:248)
      	at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
      	at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
      	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:723)
      	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:663)
      	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:394)
      	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:358)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      	at com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
      	at com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      	at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
      	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
      	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
      	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
      	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
      	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
      	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
      	at java.lang.Thread.run(Thread.java:595)

      Comment

      Working...
      X