Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » ElipseLink configuration problem in E4 RCP app(EclipseLink works fine in a test but not within e4 RCP)
ElipseLink configuration problem in E4 RCP app [message #1412711] Tue, 26 August 2014 22:19 Go to next message
Don Smyth is currently offline Don SmythFriend
Messages: 35
Registered: April 2013
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 xmlns:xsi=""
  version="2.0" xmlns="">
  <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:
JPA-PersistenceUnits: com.test.jpa

NB I am using plugins rather than OSGI bundles, and com.test.jpa is the persistence plugin.

Re: ElipseLink configuration problem in E4 RCP app [message #1412834 is a reply to message #1412711] Wed, 27 August 2014 07:26 Go to previous message
Don Smyth is currently offline Don SmythFriend
Messages: 35
Registered: April 2013
Doh! I changed the log4jdbc.DriverSpy to the hsqldb jdbc driver and all works fine.
Previous Topic:Generating Metadata using M2E
Next Topic:Right outer join
Goto Forum:

Current Time: Thu Nov 26 10:44:18 GMT 2015

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

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