Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IllegalArgumentException: argument type mismatch

 
Peter Vennel
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting the following exception while submitting my form.

Error Stack Trace



I have located the line of code which triggers this. It is in the second line of jsp code below :



If I mask that line, then I do not get this error. I am not sure what's going wrong here.

Above all, the Multiselect list box gets properly loaded with the values I set in my action class.

My code snippets are as below :

AccountGroupForm.java
 
Nate Leech
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<html: OptionsCollection property="planList" label="columnName" value="columnCd"/>


Not 100% sure, but I think you need to use name="planList" instead of property ="planList"

Hope this works!

-Nate
 
Fisher Daniel
Ranch Hand
Posts: 582
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I ussually using code like this



hope this help and correct me if I am wrong

thanks
daniel
 
Peter Vennel
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Guys.

But my tag syntax is correct in all respect. Infact I have used it in the past without any problems.

In , the form bean contains an array of objects in the property planList that we want the label and values to come from. (Ref. Struts KickStart - Tuener & Bedell)

This is some other issue.

Peter
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your tag is trying to call getPlanList() on your ActionForm. Your code shows getPlanList() in the bean.

And judging by the error type, I believe your ActionForm might have a getPlanList() but with parameters. Otherwise the error would be that no method was found.
 
Peter Vennel
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Marc.

My ActionForm does not have any getPlanList() with parameters. It only has getPlanList() with no parameters.

Peter.
 
Peter Vennel
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Found the problem!



In the above, the variable <authorizedPlans> was defined by me as ArrayList in the form. While debugging, I found out that it should be of type String[].

I feel the error logging of struts is not that good. I had not clue that this was the variable causing the problem.

Anyway, the problem has been resolved.

Thanks to all for your help.

Peter

[ February 16, 2005: Message edited by: Peter Vennel ]
[ February 16, 2005: Message edited by: Peter Vennel ]
 
mohamed zafer
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am facing a similar problem


<nested:select multiple="true" property="answer">
<nested:nest property="options">
<nested:iterate property="option">
<option value='<nested:write property="property" />'><nested:write property="labelProperty" /></option><br>
</nested:iterate>
</nested:nest>
</nested:select>

The property "answer" is a string array, still i get the same error "java.lang.IllegalArgumentException: argument type mismatch" on submitting

Any idea

Thanks
Zafer
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic