This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IllegalArgumentException: Cannot convert value of type [java.lang.String] to required

 
Vyas Sanzgiri
Ranch Hand
Posts: 686
Chrome Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a Date data type in form and when I try to input this
dateChanged is of data type Date which resides in input.processParameters.dateChanged. How do I fix this? I read something about initBinder but not sure.

Spring throws the following error:



If I use the following intiBinder:


I get the following error:
 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are the versions of JRE and Spring you're using?
 
Vyas Sanzgiri
Ranch Hand
Posts: 686
Chrome Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JRE 1.5

Spring 2.5.6

How does that matter??
 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vyas Sanzgiri wrote:JRE 1.5

Spring 2.5.6

How does that matter??

It *could* matter, because they are software they have bugs. You're using Sun JRE or OpenJDK JRE?

Anyway, from the error log why there are 2 dates: 2009-09-21 and 2009-08-20?
And please post your command class code.
 
Vyas Sanzgiri
Ranch Hand
Posts: 686
Chrome Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sun JRE.

There are 2 dates cause processParameters is a ArrayList inside Input class and processParameters contains a dateChanged field
 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post the command class source code.
 
Vyas Sanzgiri
Ranch Hand
Posts: 686
Chrome Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you mean the form here is the code:



 
Hong Anderson
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Change this:


To this:
 
Vyas Sanzgiri
Ranch Hand
Posts: 686
Chrome Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does not work same error :

Field [2009-08-20] isn't an enum value java.lang.NoSuchFieldException: 2009-08-20
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic