• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

IllegalArgumentException: argument type mismatch

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 582
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic