Problem compiling qrcode in Grails 2.0.1

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem compiling qrcode in Grails 2.0.1

glalejos
Hi,

I've been using the qrcode plugin in Grails 1.3.7 and worked flawlessly. But now I'm upgrading my project to Grails 2.0.1 and the following error is shown when executing the "grails run-app" command:

| Error Compilation error: startup failed:
C:\Users\ggla\.grails\2.0.1\projects\antariweb\plugins\qrcode-0.1\grails-app\controllers\org\codehaus\groovy\grails\plugins\qrcode\QrcodeController.groovy: The [getSize] action accepts a parameter of type [java.util.Map] 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.

I don't know what's wrong. Any clue?

Thanks in advance,

Guillermo
Reply | Threaded
Open this post in threaded view
|

Re: Problem compiling qrcode in Grails 2.0.1

Burt Beckwith
Administrator
It was allowable before 2.0 to have a public method in a controller, but they
didn't make sense since controller methods aren't called by application code,
they're called by Grails. In 2.0 we allow actions to be methods or closures,
so public methods have to be actions. Helper methods need to be private; so
the fix is to change

   String getSize(Map params) {
   ...
   }

   private String getSize(Map params) {
   ...
   }

Burt

On Wednesday, February 15, 2012 03:09:13 AM glalejos [via Grails Plugins]
wrote:
>
> Hi,
>
> I've been using the qrcode plugin in Grails 1.3.7 and worked flawlessly. But
> now I'm upgrading my project to Grails 2.0.1 and the following error is
> shown when executing the "grails run-app" command:
>
> | Error Compilation error: startup failed:
> C:\Users\ggla\.grails\2.0.1\projects\antariweb\plugins\qrcode-0.1\grails-
app\controllers\org\codehaus\groovy\grails\plugins\qrcode\QrcodeController.groovy:

> The [getSize] action accepts a parameter of type [java.util.Map] 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.
>
> I don't know what's wrong. Any clue?
>
> Thanks in advance,
>
> Guillermo
>
> _______________________________________________
> If you reply to this email, your message will be added to the discussion
below:
> http://grails-plugins.847840.n3.nabble.com/Problem-compiling-qrcode-in-
Grails-2-0-1-tp3746591p3746591.html
> To start a new topic under Grails Plugins, email ml-
[hidden email]
> To unsubscribe from Grails Plugins, visit
Reply | Threaded
Open this post in threaded view
|

Re: Problem compiling qrcode in Grails 2.0.1

glalejos
Thanks Burt, that explains a lot. Declaring the method as private worked fine. Wouldn't it be possible to add a more explanatory error message for this specific situation?

Now I have some other problems running the application, but that's another story.

Thank you again,

Guillermo