-->
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.  [ 6 posts ] 
Author Message
 Post subject: My driver is not suitable !!?
PostPosted: Mon Aug 01, 2005 4:18 am 
Beginner
Beginner

Joined: Sun Jul 31, 2005 6:15 pm
Posts: 28
After having dowloaded hibernate : 3.0.5 I wanted to to run the examples using MySql

Here is how I set my hibernate.properties file

Code:
hibernate.dialect org.hibernate.dialect.MySQLDialect
hibernate.dialect org.hibernate.dialect.MySQLInnoDBDialect
hibernate.dialect org.hibernate.dialect.MySQLMyISAMDialect
hibernate.connection.driver_class com.mysql.jdbc.Driver
hibernate.connection.url jdbc:mysql://localhost
hibernate.connection.username root
hibernate.connection.password *****


I place the JDBC driver in the lib directory.

Then I launch "ant eg" but the build failed, the first error message I got was this one

Code:
[java] 07:31:14,156  INFO DriverManagerConnectionProvider:80 - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost
[java] 07:31:14,156  INFO DriverManagerConnectionProvider:86 - connection properties: {user=root, password=****}
[java] 07:31:14,171  WARN SettingsFactory:103 - Could not obtain connection metadata
[java] java.sql.SQLException: No suitable driver


It's saying that my driver is not suitable ... I always use this driver wich is the driver I download from MySql and evrything work fine usually.

I also change the class name for the driver to org.gjt.mm.mysql.Driver but the problem remains.


Any help would be appreciated.

Michael.


Top
 Profile  
 
 Post subject: I forgot to specify the database
PostPosted: Mon Aug 01, 2005 4:43 am 
Beginner
Beginner

Joined: Sun Jul 31, 2005 6:15 pm
Posts: 28
I answer to myself

In the hibernate properties I didn't specify a database name, I was thinking that hibernate will create one for the example.

So I change the following line

Code:
hibernate.connection.url jdbc:mysql://localhost 


for this one

Code:
hibernate.connection.url jdbc:mysql://localhost/mytestdb


And it works fine, but i must say that the message

Quote:
no suitable driver


Is not really helpful.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 08, 2005 8:08 am 
Beginner
Beginner

Joined: Mon Aug 08, 2005 7:54 am
Posts: 27
Hi,

I'm quite a beginner to hibernate but i did find any post or webpage for my probably simple problem. I follow a simple tutorial but when i run my demo, i got this :

Quote:
INFO: Default entity-mode: pojo
Initial SessionFactory creation failed.java.lang.NoClassDefFoundError: org/objectweb/asm/Type


This does not appear to be coming from the tutorial source code wich is quite simple but from my config. I tried to wire hibernate with MySQL 5.0 and here are my config files :

hibernate.properties:

Code:
hibernate.dialect org.hibernate.dialect.MySQLDialect
hibernate.dialect org.hibernate.dialect.MySQLInnoDBDialect
hibernate.dialect org.hibernate.dialect.MySQLMyISAMDialect
hibernate.connection.driver_class com.mysql.jdbc.Driver
hibernate.connection.url jdbc:mysql://localhost/test
hibernate.connection.username root
hibernate.connection.password ****


hibernate.cfg.xml
Code:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"

"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>

    <session-factory>
        <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
        <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/test</property>
        <property name="hibernate.connection.username">root</property>
        <property name="hibernate.connection.password">****</property>
        <property name="dialect">org.hibernate.dialect.HSQLDialect</property>
        <property name="show_sql">true</property>
        <property name="transaction.factory_class">
             org.hibernate.transaction.JDBCTransactionFactory
        </property>
       <property name="hibernate.cache.provider_class">
             org.hibernate.cache.HashtableCacheProvider
        </property>
        <property name="hibernate.hbm2ddl.auto">update</property>

        <mapping resource="com/ao/hibernateTutorial/Event.hbm.xml"/>

    </session-factory>

</hibernate-configuration>


My mapping seems to be correct, as my db's url... I'm quite dazed and confused...

Thanks for any help you can provide...

_________________
Belaran,
"Slowly climbing the moutain of Hibernate's mystery..."


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 08, 2005 8:11 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
http://www.hibernate.org/?cmd=srchdoc&q ... FoundError


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 08, 2005 8:18 am 
Beginner
Beginner

Joined: Mon Aug 08, 2005 7:54 am
Posts: 27
Well obviously a class is missing, but i allready added those missing classes which come from the asm package ( bytes code manipulations).
Unfortunaly, it didn't do the trick. The package comes from a totally external package, so it seems to me quite odd that a simple-demo-persistance should require such an strange package...
Morover, the tutotial i followed to get there specified all the jar files i needed and they never spoke about asm.

I should have specified that i allready tried asm.jar... Sorry. If you have any other advice or some remarks concerning asm.jar...

_________________
Belaran,
"Slowly climbing the moutain of Hibernate's mystery..."


Top
 Profile  
 
 Post subject: no suitable driver with mysql... you just have to ...
PostPosted: Sat Sep 10, 2005 3:42 am 
Newbie

Joined: Sat Sep 10, 2005 3:05 am
Posts: 6
Location: Paris
yes, i had this problem too.
thanks for saying that the database must be said :
hibernate.connection.url jdbc:mysql://localhost/mytestdb

and you have to create an empty database too (mytestdb) in mysql...

_________________
Antoine Herzog.
JBoss Portal and GateIn (JSR-286), JSF, Richfaces, J2EE, Drools, BRMS.
http://www.sysemo.com/Sysemo-expertise- ... portal.php


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.