• 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

Struts: Error 500 - BeanUtils.populate

Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I have one action extending LookupDispatchAction. In this action there are three different methods, one for each possible action type (determined by getKeyMethodMap()).

My JSP uses the nested taglib and indexed properties. Basicly the JSP contains two text fields and a delete button for each element in a ArrayList (stored in the rootBean). Two form-wide buttons exist (add/execute), where add adds a pair of text fields + delete button to the JSP (via form submit). The page looks like:

**Text field** **Text field** ** Delete button**
**Text field** **Text field** ** Delete button**
**Add button** **Execute button**

My problem: sometimes(very rarely) when I rapidly presses delete buttons, one after another, I get the following error message:

Anyone got a clue of what causing this error? I would say that this error occurs 1 times out of 100. My Action class is thread-safe (since it only uses local variables and no shared resources).

Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is most likely happening is the application is trying to access an element of your ArrayList that is no longer there. Let's assume you hit a delete key to delete element 4 from a four element list. Your app begins processing the logic and deletes the element from the collection (leaving a three element list), but before it can return the response, you hit the button again telling it to delete element 4, which of course is no longer there, and the fourth element is in fact now out of bounds in your three element list.
Don't sweat petty things, or pet sweaty things. But cuddle this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
    Bookmark Topic Watch Topic
  • New Topic