【发布时间】:2016-02-02 15:31:26
【问题描述】:
环境
Grails 2.4.4
PostgreSQL 9.4
JDK 1.7
这是我的original question。
所以,我就这样改了/myApp/target/work/plugins/db-reverse-engineer-4.0.0/scripts/DbReverseEngineer.groovy。
mergedConfig.driverClassName = dsConfig.driverClassName ?: 'org.postgresql.Driver'
mergedConfig.password = dsConfig.password ?: ''
mergedConfig.username = dsConfig.username ?: 'postgres'
mergedConfig.url = dsConfig.url ?: "jdbc:postgresql://localhost:5432/myDB"
我根据 Burt 和 Emmanuel 的建议更改了插件和依赖项。当我运行 grails db-reverse-engineer command 时,我得到了这个错误。
Compilation error: startup failed:
Compile error during compilation with javac.
/home/Documents/Grails_Workspace/myApp/target/work/plugins/cache-1.1.8/src/java/grails/plugin/cache/web/GenericResponseWrapper.java:203: error: method does not override or implement a method from a supertype
@Override
^
/home/Documents/Grails_Workspace/myApp/target/work/plugins/cache-1.1.8/src/java/grails/plugin/cache/web/filter/PageFragmentCachingFilter.java:389: error: cannot find symbol
contentType = response.getContentType();
^
symbol: method getContentType()
location: variable response of type HttpServletResponse
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
谁能向我解释这些错误的含义以及如何解决它们?
我尝试使用 Grails 3.0.12 并遵循 Grails 3 中的 DB reverse engineer 教程,但我比以往任何时候都迷失了方向。
提前致谢。
编辑
/Grails_Workspace/dbTest/target/work/plugins/db-reverse-engineer-4.0.0/src/groovy/grails/plugin/reveng/Reenigne.groovy: 92: Access to org.hibernate.cfg.Environment#DRIVER is forbidden @ line 92, column 14.
properties[Environment.DRIVER] = driverClass
. ^
.
Access to org.hibernate.cfg.Environment#PASS is forbidden @ line 93, column 14.
properties[Environment.PASS] = password
. ^
.
Access to org.hibernate.cfg.Environment#URL is forbidden @ line 94, column 14.
properties[Environment.URL] = url
. ^
.
Access to org.hibernate.cfg.Environment#USER is forbidden @ line 95, column 14.
properties[Environment.USER] = username
. ^
.
Access to org.hibernate.cfg.Environment#DIALECT is forbidden @ line 97, column 15.
properties[Environment.DIALECT] = dialect
. ^
.
Access to org.hibernate.cfg.Environment#DEFAULT_SCHEMA is forbidden @ line 100, column 15.
properties[Environment.DEFAULT_SCHEMA] = defaultSchema
. ^
.
Access to org.hibernate.cfg.Environment#DEFAULT_CATALOG is forbidden @ line 103, column 15.
properties[Environment.DEFAULT_CATALOG] = defaultCatalog
^
【问题讨论】: