No Suitable Drive Found for jdbc.derby

Posted on 2011-04-19
Last Modified: 2012-06-21
Eclipse Helios Service Release 2
Hibernate 3.3.2

Hello Experts,

I'm trying to get Hibernate to export an annotated schema to a Derby database, but I get a "no suitable drive found' error.  I've been searching online and checked out many forums  and basically the suggestions have been to check the .jar file to make sure it has the correct class file (org.apache.derby.jdbc.ClientDriver) inside the derbyclient.jar file, make sure the .jar files are in the classpath and make sure that the hibernate.cfg.xml file is correct and well formed.  I'm not seeing what is wrong.  I need another set of eyes.

Here is the stacktrace:

22:27:10,368  INFO Version:15 - Hibernate Annotations 3.4.0.GA
22:27:10,391  INFO Environment:500 - Hibernate 3.2.0.cr5
22:27:10,400  INFO Environment:533 - not found
22:27:10,403  INFO Environment:667 - Bytecode provider name : cglib
22:27:10,409  INFO Environment:584 - using JDK 1.4 java.sql.Timestamp handling
22:27:10,509  INFO Version:14 - Hibernate Commons Annotations 3.1.0.GA
22:27:10,524  INFO Configuration:1350 - configuring from resource: hibernate.cfg.xml
22:27:10,524  INFO Configuration:1327 - Configuration resource: hibernate.cfg.xml
22:27:10,637 DEBUG DTDEntityResolver:38 - trying to resolve system-id []
22:27:10,638 DEBUG DTDEntityResolver:40 - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
22:27:10,640 DEBUG DTDEntityResolver:50 - located [] in classpath
22:27:10,691 DEBUG Configuration:1311 - hibernate.connection.driver_class=org.apache.derby.jdbc.ClientDriver
22:27:10,692 DEBUG Configuration:1311 - connection.url=jdbc.derby://localhost:1527/HibernateDb;create=true
22:27:10,692 DEBUG Configuration:1311 - username=user
22:27:10,694 DEBUG Configuration:1311 - connection.password=password
22:27:10,694 DEBUG Configuration:1311 - connection.pool_size=2
22:27:10,695 DEBUG Configuration:1311 - dialect=org.hibernate.dialect.DerbyDialect
22:27:10,695 DEBUG Configuration:1311 - current_session_context_class=thread
22:27:10,695 DEBUG Configuration:1311 - cache.provider_class=org.hibernate.cache.NoCacheProvider
22:27:10,696 DEBUG Configuration:1311 - show_sql=true
22:27:10,697  INFO Configuration:1465 - Configured SessionFactory: null
22:27:10,697 DEBUG Configuration:1466 - properties: {hibernate.connection.password=password,
22:27:10,733  INFO Dialect:141 - Using dialect: org.hibernate.dialect.DerbyDialect
22:27:10,831 DEBUG AnnotationConfiguration:258 - Execute first pass mapping processing
22:27:10,925 DEBUG AnnotationConfiguration:529 - Process hbm files
22:27:10,925 DEBUG AnnotationConfiguration:537 - Process annotated classes
22:27:10,934  INFO AnnotationBinder:419 - Binding entity from annotated class: com.hibernate.chapter1.Employee
22:27:10,967 DEBUG Ejb3Column:161 - Binding column DTYPE. Unique false. Nullable false.
22:27:10,999 DEBUG EntityBinder:295 - Import with entity name Employee
22:27:11,021  INFO EntityBinder:422 - Bind entity com.hibernate.chapter1.Employee on table Employee
22:27:11,032 DEBUG AnnotationBinder:1022 - Processing com.hibernate.chapter1.Employee property annotation
22:27:11,114 DEBUG AnnotationBinder:1133 - Processing annotations of com.hibernate.chapter1.Employee.empID
22:27:11,123 DEBUG Ejb3Column:161 - Binding column empID. Unique false. Nullable false.
22:27:11,124 DEBUG AnnotationBinder:1257 - empID is an id
22:27:11,130 DEBUG SimpleValueBinder:220 - building SimpleValue for empID
22:27:11,135 DEBUG PropertyBinder:131 - Building property empID
22:27:11,142 DEBUG AnnotationBinder:1293 - Bind @Id on empID
22:27:11,143 DEBUG AnnotationBinder:1133 - Processing annotations of com.hibernate.chapter1.Employee.empName
22:27:11,144 DEBUG Ejb3Column:161 - Binding column empName. Unique false. Nullable true.
22:27:11,149 DEBUG PropertyBinder:110 - binding property empName with lazy=false
22:27:11,152 DEBUG SimpleValueBinder:220 - building SimpleValue for empName
22:27:11,153 DEBUG PropertyBinder:131 - Building property empName
22:27:11,156 DEBUG AnnotationConfiguration:401 - processing fk mappings (*ToOne and JoinedSubclass)
22:27:11,159 DEBUG Configuration:1044 - processing extends queue
22:27:11,159 DEBUG Configuration:1048 - processing collection mappings
22:27:11,160 DEBUG Configuration:1059 - processing native query and ResultSetMapping mappings
22:27:11,160 DEBUG Configuration:1067 - processing association property references
22:27:11,161 DEBUG Configuration:1089 - processing foreign key constraints
22:27:11,162  INFO AnnotationConfiguration:369 - Hibernate Validator not found: ignoring
22:27:11,255 DEBUG AnnotationConfiguration:258 - Execute first pass mapping processing
22:27:11,256 DEBUG AnnotationConfiguration:529 - Process hbm files
22:27:11,257 DEBUG AnnotationConfiguration:537 - Process annotated classes
22:27:11,257 DEBUG AnnotationConfiguration:401 - processing fk mappings (*ToOne and JoinedSubclass)
22:27:11,258 DEBUG Configuration:1044 - processing extends queue
22:27:11,258 DEBUG Configuration:1048 - processing collection mappings
22:27:11,258 DEBUG Configuration:1059 - processing native query and ResultSetMapping mappings
22:27:11,259 DEBUG Configuration:1067 - processing association property references
22:27:11,268 DEBUG Configuration:1089 - processing foreign key constraints
22:27:11,273  INFO SchemaExport:154 - Running hbm2ddl schema export
22:27:11,275 DEBUG SchemaExport:170 - import file not found: /import.sql
22:27:11,275  INFO SchemaExport:179 - exporting generated schema to database
22:27:11,280  INFO DriverManagerConnectionProvider:41 - Using Hibernate built-in connection pool (not for production use!)
22:27:11,281  INFO DriverManagerConnectionProvider:42 - Hibernate connection pool size: 2
22:27:11,281  INFO DriverManagerConnectionProvider:45 - autocommit mode: false
22:27:11,300  INFO DriverManagerConnectionProvider:80 - using driver: org.apache.derby.jdbc.ClientDriver at URL: jdbc.derby://localhost:1527/HibernateDb;create=true
22:27:11,301  INFO DriverManagerConnectionProvider:83 - connection properties: {password=password}
22:27:11,302 DEBUG DriverManagerConnectionProvider:93 - total checked-out connections: 0
22:27:11,302 DEBUG DriverManagerConnectionProvider:109 - opening new JDBC connection
22:27:11,305 ERROR SchemaExport:202 - schema export unsuccessful
java.sql.SQLException: No suitable driver found for jdbc.derby://localhost:1527/HibernateDb;create=true
   at java.sql.DriverManager.getConnection(

Open in new window

And here is the Hibernate.cfg.xml file:

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



<!-- Database connection settings -->

     <property name="connection.driver_class">org.apache.derby.jdbc.ClientDriver</property>
     <property name="connection.url">jdbc.derby://localhost:1527/HibernateDb;create=true</property> 
     <property name="username">user</property> 
     <property name="connection.password">password</property>
     <!-- JDBC connection pool (use the built-in -->
     <property name="connection.pool_size">2</property>
     <!-- SQL dialect --> 
     <property name="dialect">org.hibernate.dialect.DerbyDialect</property> 
     <!-- Enable Hibernate's current session context -->
     <property name="current_session_context_class">thread</property>
     <!-- Diable the second level cache -->
     <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
     <!-- Echo all executed SQL to stdout -->
     <property name="show_sql">true</property>
     <!-- Drop and re-create the database schema on startup -->
    <!--  <property name="">create</property>-->
     <!--<mapping resource="org/hibernate/tutorial/domain/Event.hbm.xml"></mapping> -->

Open in new window

Question by:brohjoe
    LVL 92

    Expert Comment

    >      <property name="connection.url">jdbc.derby://localhost:1527/HibernateDb;create=true</property>

    should be:

         <property name="connection.url">jdbc:derby://localhost:1527/HibernateDb;create=true</property>
    LVL 47

    Expert Comment


    Check this, maybe it could give you some clue:

    Author Comment

    objects:  Did you just repeat yourself or am I missing the point?

    for_yan:  No help there.
    LVL 92

    Accepted Solution

    should be a :  between jdbc and derby, not a .

    Author Closing Comment

    objects:  You are da man!!!
    LVL 20

    Expert Comment

    by:Sathish David Kumar N
    Have you check your Hibernate.cfg.xml  

    is in path !!

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
    CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
    Video by: Michael
    Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
    Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now