Hibernate tools giving error in Eclipse STS when connecting to MySQL database

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.

+4
source share
1 answer

I had this problem twice. Over the past two weeks ... I had to move everything to a famous car, and I came across it again. The first time I fixed it, literally deleting any links to public posts anywhere in my pom.xml. I'm not sure if you use Maven or not, but this is no longer for me.

 <exclusions> <!-- Exclude Commons Logging in favor of SLF4j --> <exclusion> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </exclusion> </exclusions> 

I, as we say, create a new project from scratch and ran into this problem at the same point.

I found very little information about this problem, which for me seems so strange as you stumble upon it, simply creating a new project with sleep mode and you can easily duplicate it.

I NEED a logging, so I plan to install this using a log. When I do this, I will send my answer. If you find a viable solution, can you send a message? Thanks!

+2
source

All Articles