今天使用grails generate-all时出现错误:Domain class not found in grails-app/domain, tryinghibernatemapped classes
解决方法是将原命名:grails generate-alldomain-class-name改为:grails generate-allproject-name.domain-class-name
(注意,类名有大小写区别)
我是花了一上午时间,最后请教高人才测试出来的。
顺便将网上查找相关问题解决方法摘录下来,以免大家查找辛苦
1.
提示:No domain class found for name Status. Please try again and enter a valid domain class name
原因:据说是grails的bug
解决方案:将C:/Documents and Settings/luojiahui/.grails/1.1/projects某个项目下classes下面的.class全部删除,然后重新运行
见:http://hbluojiahui.blog.163.com/blog/static/310647672009822102740458/
2.
i) Stop all the running grails app ctrl+C
ii) grails clean
iii) Now try grails generate-all domain-class-name
见:http://parasjain01.wordpress.com/2009/06/23/grails-no-domain-class-found-for-name-please-try-again-and-enter-a-valid-domain-class-name/
3.
如果grails返回信息为 “Domain class not found in grails-app/domain ……”,在Eclipse中的project属性中找到groovy的插件,把“disable groovy compiler generate classes file ”和“disable check package matches source directory”勾上就好了。
见:http://princeicelk.javaeye.com/blog/137888
grails中 grails generate-all错误解决方法
最新推荐文章于 2024-08-30 13:29:17 发布