-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: GenericJDBCException on Hibernate Artefact Generation
PostPosted: Fri Mar 11, 2005 5:09 am 
Newbie

Joined: Fri Mar 11, 2005 5:01 am
Posts: 2
Location: France - Paris
When I try to do a reverse engineering from jdbc connection, I have a GenericJDBException with an under Exception that ask if MySQL is running.
I don't understand, because MySQL is running on the good default port of my localhost.

Hibernate version:3.0

Full stack trace of any exception that occurs:
org.hibernate.exception.GenericJDBCException: Getting database metadata
at org.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:92)
at org.hibernate.exception.ErrorCodeConverter.convert(ErrorCodeConverter.java:80)
at org.hibernate.cfg.JDBCBinder.getMetaData(JDBCBinder.java:678)
at org.hibernate.cfg.JDBCBinder.readTables(JDBCBinder.java:566)
at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:101)
at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfiguration.java:40)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard$3.execute(ArtifactGeneratorWizard.java:213)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:76)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.buildConfiguration(ArtifactGeneratorWizard.java:210)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.doFinish(ArtifactGeneratorWizard.java:147)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard.access$0(ArtifactGeneratorWizard.java:127)
at org.hibernate.eclipse.console.wizards.ArtifactGeneratorWizard$1.run(ArtifactGeneratorWizard.java:95)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:111)
Caused by: java.sql.SQLException: Cannot connect to MySQL server on 127.0.0.1:3306. Is there a MySQL server running on the machine/port you are trying to connect to? (java.lang.NumberFormatException)
at org.gjt.mm.mysql.Connection.connectionInit(Unknown Source)
at org.gjt.mm.mysql.jdbc2.Connection.connectionInit(Unknown Source)
at org.gjt.mm.mysql.Driver.connect(Unknown Source)
at org.hibernate.console.FakeDelegatingDriver.connect(FakeDelegatingDriver.java:23)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
at org.hibernate.cfg.JDBCBinder.getConnnection(JDBCBinder.java:691)
at org.hibernate.cfg.JDBCBinder.getMetaData(JDBCBinder.java:676)
... 10 more

Name and version of the database you are using:
MySql 4.1.9-max

hibernate.cfg.xml
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/test</property>
<property name="hibernate.connection.driver_class">org.gjt.mm.mysql.Driver</property>
</session-factory>
</hibernate-configuration>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 11, 2005 8:38 am 
Expert
Expert

Joined: Fri Nov 07, 2003 4:24 am
Posts: 315
Location: Cape Town, South Africa
Quote:
I don't understand, because MySQL is running on the good default port of my localhost.

Obviously not. This exception is being thrown from the driver. Try connecting using an admin tool and the same properties specified. Also check your permission - MySql may be shutting you out based on your host etc.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 14, 2005 10:08 am 
Newbie

Joined: Fri Mar 11, 2005 5:01 am
Posts: 2
Location: France - Paris
Quote:
Obviously not. This exception is being thrown from the d
drj wrote:
river. Try connecting using an admin tool and the same properties specified. Also check your permission - MySql may be shutting you out based on your host etc.


In fact, it is.
The problem was that I used an older version of MySQL driver.
Thanks

Thomas


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.