I am using Eclipse STS 3.1.0 with Hibernate Tools 3.6.0. I am trying to connect to a MySQL 5.5 database to create my DAO classes. I am using the mysql-connector-java-5.1.21.jar mysql driver
When setting up the hibernate console file (from the Hibernate tools), I was able to successfully ping my database. Therefore, I assume that my version of the driver is fine.
After setting up the hibernate console file, when I try to create the Hibernate Reverse Engineering file (reveng.xml), I get the following error:
An internal error occurred during: "Fetching children of Database".
I see the following stack trace in the STS error log -
java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V at org.apache.commons.logging.impl.SLF4JLocationAwareLog.debug(SLF4JLocationAwareLog.java:133) at org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect.getTables(JDBCMetaDataDialect.java:26) at org.hibernate.cfg.reveng.JDBCReader.processTables(JDBCReader.java:476) at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:74) at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter$2.execute(LazyDatabaseSchemaWorkbenchAdapter.java:126) at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:63) at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:107) at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.readDatabaseSchema(LazyDatabaseSchemaWorkbenchAdapter.java:115) at org.hibernate.eclipse.console.workbench.LazyDatabaseSchemaWorkbenchAdapter.getChildren(LazyDatabaseSchemaWorkbenchAdapter.java:65) at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:106) at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:235) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
I use the steps to use the Hibernate tools described in this link .
Thank any help or pointers to fix this problem. Thanks.
UPDATE
I upgraded to STS 3.2.0 and installed JBoss Tools 4.0.0
I created a simple maven quickstart project and followed all the steps mentioned in the link
In this installation, I was able to successfully generate entity classes and DAOs for database tables. I also did not have to restart STS. He did an excellent job with the first attempt.
This works fine with MySQL 5.5 as well as with Oracle 11g.
source share