MissingMethodException building basic tutorial app with maven

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

MissingMethodException building basic tutorial app with maven

I'm new to grails and evaluating it for a project in which we already use maven. I followed the steps described in http://grails.org/doc/latest/guide/4.%20The%20Command%20Line.html#4.5%20Ant%20and%20Maven to create a new maven-based grails project using version 1.3.7. I had to manually uncomment the maven central repo from BuildConfig.groovy to get the project to complete initialization, because it complained about not finding a hibernate dependency.

After that I ran mvn grails:create-domain-class and created a Race domain class. I edited the file and added a single String field, called "name". Then I ran mvn grails:create-controller and created a RaceController class. I edited that class and changed it to only have "def scaffold = Race" inside the class.

Next I ran mvn grails:run-app. The first time this failed with this error:

2011-07-06 18:30:25,894 [main] ERROR startup.ContextConfig  - alt-dd file /projects/tmp/grails/myapp/target/resources/web.xml not found

I tried it again and the server started ok, so I went to localhost:8080/myapp in my browser. When I clicked on the RaceController on the default Grails page, I got this exception:

2011-07-06 18:31:40,373 [http-8080-4] ERROR errors.GrailsExceptionResolver  - Exception occurred when processing request: [GET] /myapp/race/list
Stacktrace follows:
groovy.lang.MissingMethodException: No signature of method: static myapp.Race.list() is applicable for argument types: (org.codehaus.groovy.grails.web.servlet.mvc.GrailsParameterMap) values: [[action:list, controller:race, max:10]]
Possible solutions: is(java.lang.Object), wait(), wait(long), with(groovy.lang.Closure), print(java.lang.Object), find(groovy.lang.Closure)
        at myapp.RaceController$_closure2.doCall(script13099986884621757869167.groovy:13)
        at myapp.RaceController$_closure2.doCall(script13099986884621757869167.groovy)
        at java.lang.Thread.run(Thread.java:680)

I guess I may have made some newb mistake, but I did so little I don't see what I could have done wrong. Does the maven integration with grails 1.3.7 actually work?