Monday 24 August 2009

Grails - Error generating scaffolded view

While running Grails application with dynamic scaffolding, I got following error:


Error generating scaffolded view [/product/index]: C:\grails\grails-1.1.1\src\grails\templates\scaffolding\index.gsp (Th
e system cannot find the file specified)
java.io.FileNotFoundException: C:\grails\grails-1.1.1\src\grails\templates\scaffolding\index.gsp (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(FileInputStream.java:106)


The problem was caused because I had index defined in my auto generated Controller class.

For Example:
class BookController {
def scaffold = Book

def index = { }
}
In above case, removing index resolved my problem.

2 comments: