Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Hibernate: driver not found com.mysql.JDBC.driver
Hibernate: driver not found com.mysql.JDBC.driver [message #615427] Thu, 07 February 2008 14:27
Yigal Spinner is currently offline Yigal SpinnerFriend
Messages: 111
Registered: July 2009
Senior Member
I created a simple Plugin that uses Teneo, Hibernate and mySql.
When I run my unit test directly on the class that does the database
persistence operations, all tests pass.

When I run my test as a plugin then I get an error that the Hibernate
can not find the mySql driver. The Unit test uses Junit3 and in
headless mode.

I have the mySQL plugin from the Eclipse web site as a dependency.
I have the mySQL JAR in a lib directory and set the classpath to point
to it. I tried all kind of combination, but I can not make it work.

Here is the code for setting the hibernate:

final Properties teneoProperties = new Properties();
teneoProperties.setProperty(PersistenceOptions.USE_MAPPING_F ILE, "true");
final Properties hibernateProperties = new Properties ();
hibernateProperties.setProperty(Environment.DRIVER,
"com.mysql.jdbc.Driver");
hibernateProperties.setProperty(Environment.USER, "root");
hibernateProperties.setProperty(Environment.PASS, "dba");
hibernateProperties.setProperty(Environment.URL,
"jdbc:mysql://picardv3.accenture.com:3306/yigaldb");
hibernateProperties.setProperty(Environment.DIALECT,
org.hibernate.dialect.MySQLInnoDBDialect.class.getName());

// Initialize dataStore
String datastoreName = "domain";
dataStore = HbHelper.INSTANCE.createRegisterDataStore(datastoreName);
dataStore.setEPackages(new EPackage[] { DomainPackage.eINSTANCE });
dataStore.setPersistenceProperties(teneoProperties);
dataStore.setHibernateProperties(hibernateProperties);
dataStore.initialize();


Any ideas how to fix this?

Thanks
Yigal
Previous Topic:[Teneo] Generated identifier names too long
Next Topic:Hibernate: driver not found com.mysql.JDBC.driver
Goto Forum:
  


Current Time: Sun Oct 25 11:59:27 GMT 2020

Powered by FUDForum. Page generated in 0.01286 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top