Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » JAP and RCP javax.persistence.PersistenceException: No Persistence provider for EntityManager named
JAP and RCP javax.persistence.PersistenceException: No Persistence provider for EntityManager named [message #662074] Tue, 29 March 2011 07:50 Go to next message
Oliver Kolling is currently offline Oliver KollingFriend
Messages: 24
Registered: April 2010
Junior Member
hi everybody,

I'm trying to use eclipselink in an RCP application, but I can't get it to work. I tried first to use it in an Java main (non rcp -application) which worked out of the box. I also installed DALI and it works perfect for mapping my Oracle tables with my entities, but as soon as I try to run an RCP-App where I use the mappings I get the "No persistence provider...." thing. I think I messed up something with the classpath<>dependencies. Why is it so difficult to set that thing up?

I'm using Eclipse Helios with DALI 2.3.3.v201010220000 and EclipseLink 2.2.0.v20110202

my code is:

private static EntityManagerFactory emf = null;
private static Map<String, Object> properties = new HashMap<String, Object>();

properties.put(PersistenceUnitProperties.TARGET_DATABASE, "Oracle");
properties.put(PersistenceUnitProperties.JDBC_DRIVER,"oracle.jdbc.OracleDriver");
properties.put(PersistenceUnitProperties.JDBC_URL,"jdbc:oracle:thin:@xxxx.xxxx.xx:1521:xxx");
properties.put(PersistenceUnitProperties.JDBC_USER, "xxxx");
properties.put(PersistenceUnitProperties.JDBC_PASSWORD, "xxxx");
properties.put(PersistenceUnitProperties.BATCH_WRITING, "JDBC");
properties.put(PersistenceUnitProperties.CLASSLOADER, Application.class.getClassLoader());

Version 1:

 emf =Persistence.createEntityManagerFactory("JPA_RCP_Test2");

Result: javax.persistence.PersistenceException: No Persistence provider for EntityManager named JPA_RCP_Test2

Version 2: 
		
 emf =Persistence.createEntityManagerFactory("JPA_RCP_Test2", properties);

Result: javax.persistence.PersistenceException: No Persistence provider for EntityManager named JPA_RCP_Test2

Version 3:

 emf = new Persistence().createEntityManagerFactory("JPA_RCP_Test2", properties);

Result: javax.persistence.PersistenceException: No Persistence provider for EntityManager named JPA_RCP_Test2


I also tried to create plugins from javax.persistence_2.0.3.v201010191057.jar and all the org.eclipse.persistence jars to link them as required plugins...

I'm working on this now for several days without a proper solution. I also tried to follow nearly all posts, I was able to find and could not solve this issue. Can please someone help me or point me to a step by step tutorial on how to get that running under RCP.
I'm running out of options here.

Oliver.

[Updated on: Tue, 29 March 2011 08:23]

Report message to a moderator

Re: JAP and RCP javax.persistence.PersistenceException: No Persistence provider for EntityManager n [message #662690 is a reply to message #662074] Thu, 31 March 2011 15:12 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

There are some EclipseLink OSGi and RCP examples here,

http://wiki.eclipse.org/EclipseLink/Examples/OSGi


James : Wiki : Book : Blog : Twitter
Previous Topic:Cascade persist and map keys
Next Topic:ClassCastException on EntityManager.getCriteriaBuilder()
Goto Forum:
  


Current Time: Fri Apr 19 22:11:22 GMT 2024

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

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

Back to the top