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)