I created a simple grails 2.0.1 plugin with a domain “User”. Created scaffolding controllers and views. But when I do grails run-app and goto the user/list url, I get the error
No signature of method: packagename.User.list() is applicable for argument types: () values: [] Possible solutions: list(), list(java.util.Map), is(java.lang.Object), wait(), lock(), find()
But when I use the plugin within a grails app (without publishing,packing), it works fine.
Question is – I want to be able to test the grails plugin controller without an app. Im guessing im missing some configufaration.
It looks like you don’t have the Hibernate plugin installed. It’s added to
BuildConfig.groovyby default for applications, but not for plugins. You can install it withgrails install-plugin hibernate 2.0.1and it will add it toapplication.properties, and this approach keeps it from being a dependency when users install your plugin.You can also add it to
BuildConfig.groovybut be sure to addexport = falseunless your plugin does actually require Hibernate to function. If it would work with any GORM implementation (e.g. Mongo) then it shouldn’t be exported: