Open vmptk opened 10 years ago
http://grails.org/doc/2.0.2/guide/plugins.html#creatingAndInstallingPlugins
Since Grails 2.0.2, The Grails Hibernate plugin is not included by default in a Grails plugin project. You need to include the Grails Hibernate Plugin by hand.
Hope this helps.
Thanks for the response. It seems to fix it, but now I am facing the follow one:
grails> optimus-all SignUp --stacktrace --verbose | Finished generation of 'config.properties' file | Error 'SignUp' IS NOT A DOMAIN CLASS!!! | Finished generation of 'DataSource.groovy' file | Finished generation of config artifacts | Error 'SignUp' IS NOT A DOMAIN CLASS!!! ......
It seems that the plugin doesn't find your "SingUp" domain class. I have tested the Optimus plugin within another plugin and it works. Please send me more information about your plugin and your environment.
Back to the grid.
The setup is fairly simple, I have just create a brand new plugin, then add hibernate to the plugin list (thanks for that, btw), then simple use the plugin in an grails app. Nothing special I would say. Grails version 2.3.0, Oracle JDK 1.7_15, Ubuntu 13.04.
I was trying to reproduce the problem you are facing, but I cannot get it. First, I create a new plugin (call it "newPlugin"), I install optimus and hibernate via BuildConfig.groovy, I create a domain class INSIDE newPlugin and I run optimus-all. Everything is OK.
Now, the second scenario: Create a new plugin (newPlugin), install optimus and hibernate via BuildConfig.groovy, create new Grails App, install newPlugin via BuildConfig.groovy and run optimus-all. The command is not recognized.
Did I understand you or am I wrong?
1) Create grails app (APP) 2) Create grails plugin (PLUGIN) 3) Create domain class in Plugin 4) Add PLUGIN to APP project with local pluging configuration in BuildConfig.groovy 5) Add Optimus to APP again in BuildConfig.groovy - compile, run-app 6) Open interactive console on APP and run optimus-all for the domain class
Is it suppose to run optimus in a grails plugin?
if no, skip the rest of the content :)
If yes, how to solve the follow issue: optimus-all SignUp --stacktrace | Error Error running script optimus-all SignUp --stacktrace: startup failed: _OptimusUtils_groovy: 2: unable to resolve class org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder @ line 2, column 1. _OptimusUtils_groovy: 1: unable to resolve class org.codehaus.groovy.grails.orm.hibernate.cfg.CompositeIdentity @ line 1, column 1. 2 errors (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.) org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: _OptimusUtils_groovy: 2: unable to resolve class org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder @ line 2, column 1. _OptimusUtils_groovy: 1: unable to resolve class org.codehaus.groovy.grails.orm.hibernate.cfg.CompositeIdentity @ line 1, column 1. 2 errors
| Error Error running script optimus-all SignUp --stacktrace: startup failed: _OptimusUtils_groovy: 2: unable to resolve class org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsDomainBinder @ line 2, column 1. _OptimusUtils_groovy: 1: unable to resolve class org.codehaus.groovy.grails.orm.hibernate.cfg.CompositeIdentity @ line 1, column 1. 2 errors