-->
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.  [ 4 posts ] 
Author Message
 Post subject: Problem loading DB driver in Hibernate Console
PostPosted: Wed May 04, 2005 8:02 am 
Beginner
Beginner

Joined: Sun Jan 16, 2005 5:45 pm
Posts: 24
Location: Atlanta
I’m using the latest version of the Hibernate Console from CVS. In my test project I have created the following config file.

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 name="eLoadSheet">
        <property name="dialect">net.sf.hibernate.dialect.MySQLDialect</property>
        <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
        <property name="connection.url">jdbc:mysql://gretta04/takeoff</property>
        <property name="connection.username">root</property>
        <property name="connection.password"></property>
        <property name="connection.autoReconnect">true</property>
        <property name="show_sql">true</property>
    </session-factory>
</hibernate-configuration>

When I try and create a SessionFactory I get the following exception.
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

The driver is in the project class path. It is also in the path environment variables. The console configuration contains a class path configuration option but the Add button only shows my project structure and there are no jars/zips displayed (even though the jdbc Driver has been added via Eclipse project managment).

What am I missing?


Code:
org.hibernate.console.HibernateConsoleRuntimeException: Problems while loading database driverclass (com.mysql.jdbc.Driver)
   at org.hibernate.console.ConsoleConfiguration.registerFakeDriver(ConsoleConfiguration.java:196)
   at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:156)
   at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:129)
   at org.hibernate.eclipse.console.actions.BuildSessionFactoryAction.doRun(BuildSessionFactoryAction.java:50)
   at org.hibernate.eclipse.console.actions.ConsoleConfigurationBasedAction.run(ConsoleConfigurationBasedAction.java:47)
   at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:167)
   at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538)
   at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
   at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
   at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:842)


Code:
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
   at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:361)
   at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:326)
   at org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader.loadClass(AbstractClassLoader.java:74)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Class.java:164)
   at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:108)


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 04, 2005 10:46 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
currently the jdbc driver needs to be placed *inside* the project

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 04, 2005 11:28 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
btw. just for you i've now added a "Add external JAR..." button.

its in cvs now

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 04, 2005 12:49 pm 
Beginner
Beginner

Joined: Sun Jan 16, 2005 5:45 pm
Posts: 24
Location: Atlanta
Super.. I'll check it out later today... mvh, Poul


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