我可以使用($ grails create-app MyDomain
)创建应用程序,但无法继续使用$ grails generate-all MyDomain
。
I made sure that I do have the domain generated with the proper name/spelling (by going physically into the local folder on my machine), all looks ok. The only log I get is the error message that says Error domain class not found ...that's all. I am relatively new to grails. I am following exactly as it instructs in Dzone Refcardz for Grails
关于SO有两个相关问题,但我的问题没有答案。
Domain class not found in grails-app/domain
Grails 3.x: Re-using JPA/Hibernate Domain classes: Domain class not found
我唯一的另一个疑问是:我的osx(优胜美地)上有两个版本的jdk。我已准备在个人资料中使用一个。但我不确定。根据我在网络上的阅读,这个有两个JDK不应导致
$ grails generate-all MyDomain
出错。我还有其他途径可以解决此问题吗?
最佳答案
我猜这是典型的“在创建域类时没有提供软件包”的问题。默认情况下,如果您省略软件包名称,例如如果您仅创建域类$ grails create-app MyDomain
,则MyDomain.groovy文件将在app-name
包(即MyApplication.MyDomain
)下创建。
如果是这种情况,那么您的$ grails generate-all MyDomain
实际上应该是$ grails generate-all MyApplication.MyDomain
。
关于macos - 找不到错误的网域类别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30675430/