• Post Reply Bookmark Topic Watch Topic
  • New Topic

Struts: Error 500 - BeanUtils.populate  RSS feed

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!

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).

Regards
Henrik
 
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!