Grails 2.0.1 does not like java.util.Date

1.3k views Asked by At

I updated from Grails 2.0 to 2.0.1 and started getting this error. Any ideas what broke and how to fix it?

... The [getTransactionData] action accepts a parameter of type [java.util.Date] which does not appear to be a command object class. This can happen if the source code for this class is not in this project and the class is not marked with @Validateable.

2

There are 2 answers

1
hkong On BEST ANSWER

I ran into a similar problem for a helper method in my controller. Is your getTransactionData a helper method? In my case, the problem was solved by changing the method to private, since all public methods are treated as controller actions in Grails 2.0.1+.

Credit, where credit is due: Jeff Brown's answer on nabble, though it didn't fix the problem for the original question, cured it for me: http://grails.1312388.n4.nabble.com/Grails-2-0-1-strange-behaviour-td4390405.html.

1
Burt Beckwith On

Are you using a command object that's in src/groovy? You'll need to annotate it with @Validateable - add an import for grails.validation.Validateable.