This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

IllegalArgumentException: argument type mismatch

 
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
 
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
 
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
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • 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 ]
 
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic