Grails数据库反向工程插件错误
环境Grails数据库反向工程插件错误,grails,plugins,Grails,Plugins,环境 Grails 2.4.4 PostgreSQL 9.4 JDK 1.7 这是我的 因此,我更改了/myApp/target/work/plugins/db-reverse-engineer-4.0.0/scripts/DbReverseEngineer.groovy,如下所示 mergedConfig.driverClassName = dsConfig.driverClassName ?: 'org.postgresql.Driver' mergedConfig.password =
Grails 2.4.4
PostgreSQL 9.4
JDK 1.7
这是我的
因此,我更改了/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的建议,我改变了插件和依赖关系。当我运行grailsdb反向工程命令时,我得到了这个错误
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.
谁能给我解释一下这些错误是什么意思以及如何修复它们?
我试着使用Grails3.0.12
并遵循Grails3的DB反向工程
教程,但我比以往任何时候都迷路了
提前谢谢
编辑
/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
^
该错误来自插件,而不是反向工程插件。如果您没有使用它,请从
BuildConfig.groovy
中删除它,该错误来自缓存插件,请从BuildConfig.groovy中删除它,并在依赖项中添加以下内容
compile "net.sf.ehcache:ehcache-core:2.4.6"
非常感谢你的回答。我删除了它,我得到了不同的错误。它与
重组有关。groovy
你能看看我的编辑吗?感谢您的时间和帮助。请尝试删除目标目录,然后运行grails compile
,然后查看它是否工作。谢谢。我已经删除了目标目录并运行了grails compile
,但仍然有相同的错误。是冬眠吗?我可以从哪里开始研究?