JAP and RCP javax.persistence.PersistenceException: No Persistence provider for EntityManager named [message #662074] |
Tue, 29 March 2011 07:50 |
Oliver Kolling 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
|
|
|
|
Powered by
FUDForum. Page generated in 0.03389 seconds