gre*_*fox 5 grails reverse-engineering grails-orm
我正在尝试评估Grails作为即将到来的项目的解决方案.已经有一个正在使用的大型数据库,如果全部都不会被修改.我不想将数据库反向工程为GORM域对象作为起点.
我在http://www.grails.org/plugin/db-reverse-engineer找到了一个.我安装并配置了它,但是当我运行它时,我一遍又一遍地看到同样的错误.堆栈跟踪如下.
有人可以帮我纠正错误,或推荐另一种工具用于对Grails进行逆向工程吗?我过去曾使用Netbeans将数据库逆向工程到JPA实体,这些实体效果非常好.我希望与Grails有类似的东西.
| Error Error executing script DbReverseEngineer: javax/transaction/Transaction (NOTE: Stack trace has been filtered. Us
e --verbose to see entire trace.)
java.lang.NoClassDefFoundError: javax/transaction/Transaction
at grails.plugin.reveng.GrailsJdbcBinder.readDatabaseSchema(GrailsJdbcBinder.groovy:51)
at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:93)
at org.hibernate.cfg.JDBCBinder$readFromDatabase.call(Unknown Source)
at grails.plugin.reveng.GrailsJdbcMetaDataConfiguration.readFromJDBC(GrailsJdbcMetaDataConfiguration.groovy:32)
at grails.plugin.reveng.GrailsJdbcMetaDataConfiguration$readFromJDBC.call(Unknown Source)
at grails.plugin.reveng.Reenigne.buildConfiguration(Reenigne.groovy:114)
at grails.plugin.reveng.Reenigne.execute(Reenigne.groovy:60)
at grails.plugin.reveng.Reenigne$execute.call(Unknown Source)
at grails.plugin.reveng.RevengRunner.run(RevengRunner.groovy:81)
at grails.plugin.reveng.RevengRunner$run.call(Unknown Source)
at DbReverseEngineer$_run_closure1.doCall(DbReverseEngineer:36)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:1
85)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)
at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)
at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:427)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners$0.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:415)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.executeTargets(Gant.groovy:591)
at gant.Gant.executeTargets(Gant.groovy:590)
Caused by: java.lang.ClassNotFoundException: javax.transaction.Transaction
... 29 more
| Error Error executing script DbReverseEngineer: javax/transaction/Transaction
Run Code Online (Sandbox Code Playgroud)
小智 9
实际上这个插件与Hibernate 4不兼容...... 但是,自从上一次推出就像很久以前一样,看起来你不会很快得到一个新版本来使用它:)
但是,你仍然可以继续使用这个版本的Grails和db-reverse-engineer:0.5插件,通过切换你的Hibernate版本,回到3.这很容易!
在BuildConfig.groovy中,注释行运行时":hibernate4:4.XXX"
而是添加:运行时":hibernate:3.6.10.17"
(顺便说一句,不要忘记将正确的连接器添加到您的数据库中,我自己使用这种依赖:编译'mysql:mysql-connector-java:5.1.22')
| 归档时间: |
|
| 查看次数: |
1720 次 |
| 最近记录: |