I have read a few issues by people not being able to get EclipseLink running within an RCP application. I haven't been able to solve this issue yet.
When the code below is run in a test suite persistence work fine. However an error is thrown on line 2 when I run this from an e4 RCP application:
EntityManagerFactoryHelper emFactoryHelper = new EntityManagerFactoryHelper();
em = emFactoryHelper.getFactory().createEntityManager();
javax.persistence.PersistenceException: Exception [EclipseLink-4021] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
Exception Description: Unable to acquire a connection from driver [net.sf.log4jdbc.DriverSpy], user [sa] and URL [jdbc:hsqldb:hsql://localhost/test]. Verify that you have set the expected driver class and URL. Check your login, persistence.xml or sessions.xml resource. The jdbc.driver property should be set to a class that is compatible with your database platform
Internal Exception: java.sql.SQLException: No suitable driver found for jdbc:hsqldb:hsql://localhost/test
<?xml version="1.0" encoding="UTF-8" ?>
<persistence-unit name="parameters" transaction-type="RESOURCE_LOCAL">
Manifest in persistence plugin:
... Eclipse-RegisterBuddy: com.test.mainapp ..
Manifest in main application:
... Eclipse-BuddyPolicy: registered ...
I also added the following to mainifest in the main app, though I think it is only relevent for OSGI bundles rather than plugins:
NB I am using plugins rather than OSGI bundles, and com.test.jpa is the persistence plugin.