Grails Reversing Engineers Database

I am trying to evaluate Grails as a solution for an upcoming project. There is already a large database that will not be much changed if all of this happens. I will not process the database into GORM domain objects as a starting point.

I found here http://www.grails.org/plugin/db-reverse-engineer . I installed it and configured it, but when I run it, I see the same error again and again. The column below.

Can someone help me fix a bug or recommend another reverse engineering tool for the grail? I used Netbeans in the past to reprogram databases on JPA objects that worked pretty well. I hope for something similar with 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 
+5
source share
4 answers

In fact, this plugin is not yet compatible with Hibernate 4 .... But since the last push was similar centuries ago, it does not look like you will soon get a new version to work with it :)

However, you can still use this version of Grails and the db-reverse-engineer: 0.5 plugin by switching your version of Hibernate to 3. And it's pretty easy to do!

In BuildConfig.groovy, comment out the runtime line ": hibernate4: 4.XXX"

And add instead: runtime ": hibernate: 3.6.10.17"

(And by the way, do not forget to add the correct connector to your database, I use this dependency: compile 'mysql: mysql-connector-java: 5.1.22')

+9
source

Well, the plugin uses Hibernate Tools for reverse engineering, so you can try just using them directly.

0
source

There is a new version that fixes a lot of errors, such as: 0.5.1 insead of 0.5

BuildConfig.groovy

 runtime ':db-reverse-engineer:0.5.1' 
0
source

I also ran into the same problem, but I did not switch to hibernate 3.x version. The main problem is the connector, do not comment on the mysql connector in BuildConfig.groovy and I added javax.transaction jar to the grails application lib folder, this solved the problem

0
source

Source: https://habr.com/ru/post/1202782/


All Articles