Following the example from http://grails.org/doc/2.0.x/guide/hibernate.html and then http://grails.org/doc/2.0.x/guide/scaffolding.html
to use a domain class mapped with hibernate (implemented in java with JPA annotations).
Then on attempting to create an instance of the domain class via controller/create the following error happens:
{noformat}
| Error 2012-01-17 10:47:05,645 ["http-bio-9090"-exec-8] ERROR errors.GrailsExceptionResolver - MissingPropertyException occurred when processing request: [GET] /racetrack/book/create
No such property: action for class: com.books.Book. Stacktrace follows:
Message: No such property: action for class: com.books.Book
Line | Method
->> 19 | create in com.books.BookController
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 908 | run . . in ''
^ 680 | run in java.lang.Thread
{noformat}
The code for Book, BookController and hibernate.cfg.xml is in principle (as i understand it) exactly as in the example in the documentation. But just to be clear here it is again:
{code:title=Book.java}
// Some comments here
package com.books;
Original Reporter: jaetzold Environment: Not Specified Version: 2.0 final Migrated From: http://jira.grails.org/browse/GRAILS-8641
Following the example from http://grails.org/doc/2.0.x/guide/hibernate.html and then http://grails.org/doc/2.0.x/guide/scaffolding.html to use a domain class mapped with hibernate (implemented in java with JPA annotations). Then on attempting to create an instance of the domain class via controller/create the following error happens: {noformat} | Error 2012-01-17 10:47:05,645 ["http-bio-9090"-exec-8] ERROR errors.GrailsExceptionResolver - MissingPropertyException occurred when processing request: [GET] /racetrack/book/create No such property: action for class: com.books.Book. Stacktrace follows: Message: No such property: action for class: com.books.Book Line | Method ->> 19 | create in com.books.BookController
| 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker | 908 | run . . in '' ^ 680 | run in java.lang.Thread {noformat} The code for Book, BookController and hibernate.cfg.xml is in principle (as i understand it) exactly as in the example in the documentation. But just to be clear here it is again: {code:title=Book.java} // Some comments here package com.books;
import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id;
@Entity public class Book { private Long id; private String title;
}{code}
{code:title=BookController.groovy} package com.books
class BookController { static scaffold = Book } {code}
{code:xml|title=hibernate.cfg.xml} <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE hibernate-configuration PUBLIC '-//Hibernate/Hibernate Configuration DTD 3.0//EN' 'http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd'>
{code}