1

System overview:

  • Eclipse Indigo for RAP RCP devs, RAP 1.4 Target Components, Dali JPA, Jre1.6.0_33 (Java1.6SE)
  • local oracle mysql db
  • all JPA (Persistence) + Eclipse link OSGi bundles imported in project (according to eclipse wiki)
  • OSGi bundle containing com.mysql.jdbc.Driver class imported in project (latest 5.1.21 ? from Oracle page)
  • persistence plugin created via JPA, with jdbc driver,correct mysql db path, correct password & user (added dependency to com.mysql.jdbc bundle)

To avoid ClassLoader problem:

  • bundle/plugin com.mysql.jdbc has in its MANIFEST.MF: Bundle-BuddyPolicy: registered
  • org.eclipse.persistence.core & org.eclipse.persitence.jpa and mine "persistence bundle" having Buddy registered in their MANIFEST.MF : Eclipse-RegisterBuddy:com.mysql.jdbc + they have added dependency to this bundle com.mysql.jdbc

Problem:

even after all previous steps I have still: ClassNotFoundException - Driver not found

Remark:

  • connection to localhost mysql db tested from inside Eclipse DatabaseConnection, used same driver from bundle com.mysql.jdbc (class com.mysql.jdbc.Driver) [OK]
  • if org.apache.derby Embedded db with Embeded driver is used for persistence (instead of mysql) (with same Buddy policy), problem does not appear - everything works fine

Question:

  • could it be problem still with ClassLoaders even if BuddyPolicy applied ?
  • could it be problem in driver itselves, when its used as OSGi bundle ?
  • has somebody ever try to use this com.mysql.osgi bundle in RCP or RAP together with JPA+Eclipselink ?
To Kra
  • 3,344
  • 3
  • 38
  • 45

1 Answers1

0

I found problem in mysql.jdbc bundle which had no class path defined to JDBC class driver (My mistake, I probably overseen this)... I also checked PAX JPA and I think PAX JPA is not necessary now after I changed MYSQL JDBC bundle and Buddy Policy of OSGi bundles. I want to keep it simple: Equinox + Eclipselink JPA+JDBC driver.... I solved all issues now. and everythings works fine.

To Kra
  • 3,344
  • 3
  • 38
  • 45