【发布时间】:2015-10-27 14:16:20
【问题描述】:
我一直在煞费苦心地尝试使用 Groovy Grails 工具套件自学 Grails。
GGTS 3.6.4 圣杯 2.4.4 JDK 1.8.0_45
我在书中的第 92 页有两个问题:
-
运行 Grails 控制台时,我收到以下错误:
Error | 2015-09-29 08:03:29,168 [main] ERROR hbm2ddl.SchemaExport - HHH000389: Unsuccessful: alter table post drop constraint FK_kpfnivid38f5bwx3yl1lxeeae if exists Error | 2015-09-29 08:03:29,168 [main] ERROR hbm2ddl.SchemaExport - Table "POST" not found; SQL statement: alter table post drop constraint FK_kpfnivid38f5bwx3yl1lxeeae if exists [42102-176] Error | 2015-09-29 08:03:29,168 [main] ERROR hbm2ddl.SchemaExport - HHH000389: Unsuccessful: alter table post_tags drop constraint FK_rf0kr7eqk5xoalmc4gigdwg3p if exists Error | 2015-09-29 08:03:29,168 [main] ERROR hbm2ddl.SchemaExport - Table "POST_TAGS" not found; SQL statement: alter table post_tags drop constraint FK_rf0kr7eqk5xoalmc4gigdwg3p if exists [42102-176] Error | 2015-09-29 08:03:29,168 [main] ERROR hbm2ddl.SchemaExport - HHH000389: Unsuccessful: alter table post_tags drop constraint FK_n8k2owli9ecanh4phj01mddvv if exists Error | 2015-09-29 08:03:29,168 [main] ERROR hbm2ddl.SchemaExport - Table "POST_TAGS" not found; SQL statement: alter table post_tags drop constraint FK_n8k2owli9ecanh4phj01mddvv if exists [42102-176] Error | 2015-09-29 08:03:29,168 [main] ERROR hbm2ddl.SchemaExport - HHH000389: Unsuccessful: alter table profile drop constraint FK_c1dkiawnlj6uoe6fnlwd6j83j if exists Error | 2015-09-29 08:03:29,168 [main] ERROR hbm2ddl.SchemaExport - Table "PROFILE" not found; SQL statement: alter table profile drop constraint FK_c1dkiawnlj6uoe6fnlwd6j83j if exists [42102-176] Error | 2015-09-29 08:03:29,168 [main] ERROR hbm2ddl.SchemaExport - HHH000389: Unsuccessful: alter table tag drop constraint FK_151ooxskkpn49blwsh7mjwysx if exists Error | 2015-09-29 08:03:29,168 [main] ERROR hbm2ddl.SchemaExport - Table "TAG" not found; SQL statement: alter table tag drop constraint FK_151ooxskkpn49blwsh7mjwysx if exists [42102-176] Error | 2015-09-29 08:03:29,168 [main] ERROR hbm2ddl.SchemaExport - HHH000389: Unsuccessful: alter table user_user drop constraint FK_s7pwk9swjfqs0w7ub9tt5s47y if exists Error | 2015-09-29 08:03:29,168 [main] ERROR hbm2ddl.SchemaExport - Table "USER_USER" not found; SQL statement: alter table user_user drop constraint FK_s7pwk9swjfqs0w7ub9tt5s47y if exists [42102-176] Error | 2015-09-29 08:03:29,168 [main] ERROR hbm2ddl.SchemaExport - HHH000389: Unsuccessful: alter table user_user drop constraint FK_1hl85r166108l1vgkxycm3cq0 if exists Error | 2015-09-29 08:03:29,168 [main] ERROR hbm2ddl.SchemaExport - Table "USER_USER" not found; SQL statement: alter table user_user drop constraint FK_1hl85r166108l1vgkxycm3cq0 if exists [42102-176]
我的猜测是问题是因为我没有将我的DataSource.groovy 文件更改为'update' 而不是'create-drop' 并导致数据库内存不足。
我没有测试这个理论,因为 Grails 控制台仍在运行,这导致了我的第二个错误。
-
我们被告知使用以下命令生成 4 个控制器:
create-scaffold-controller com.grailsinaction.User create-scaffold-controller com.grailsinaction.Profile create-scaffold-controller com.grailsinaction.Post create-scaffold-controller com.grailsinaction.Tag
每次,我都会收到“预期 EOF”错误:
1 compilation error:
expecting EOF, found 'com' at line: 1, column: 28
这两个错误似乎无关,与其跳过它,我真的很想了解发生了什么......
任何帮助将不胜感激。
【问题讨论】:
-
抱歉,'gobblygook' 的段落很长。我还是新手,不知道如何正确格式化...
标签: grails