Grails 2.5.6 - "Method on class was used outside of a Grails application" error
I’m using Grails 2.5.6 and I created a simple Person domain and a PersonController.
When I try to call POST /person/add, I get the following error:
Method on class [com.demo.Person] was used outside of a Grails application.
If running in the context of a test using the mocking API or bootstrap Grails correctly.
My code:
grails-app/domain/com/demo/Person.groovy
package com.demo
class Person {
String name
}
grails-app/controllers/com/demo/PersonController.groovy
package com.demo
import...