Announcement Announcement Module
No announcement yet.
using gorm outside of Grails 2.0.1 Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • using gorm outside of Grails 2.0.1

    I wrote and tested some domain and service classes using GORM and packaged them as a Grails 2.0.1 plugin jar. Now I need access to those same domain and service objects from pre-existing java code in non-Grails projects. I added my Grails plugin jar and the required dependencies to one of the java projects, but I'm not having any luck using the Grails classes. Are there instructions or examples of using GORM outside of Grails 2.0.1? I'm seeing errors like these when invoking a method on the domain class and the autowired service class:

    * java.lang.IllegalStateException: Method on class [com.XYZ] was used outside of a Grails application.
    If running in the context of a test using the mocking API or bootstrap Grails correctly.

    * groovy.lang.MissingMethodException: No signature of method:
    com.XYZ.get() is applicable for argument types: () values: []
    Possible solutions: get(, getId(), grep(), getAt(java.lang.String), grep(java.lang.Object), wait()

    I'm not sure what I need to do to configure this correctly, or where to look to find out. I haven't been able to find anything that looks like it's applicable to Grails 2.0.1. Any help is appreciated.