error during startup [message #724900] |
Tue, 13 September 2011 13:13 |
Luiz E. Messages: 100 Registered: September 2010 |
Senior Member |
|
|
hi all
i'm trying to apply some good practices during the initial phase of our new project here. i'm trying to use tycho (almos giving up, damn ) and for now, i'm facing some problems with eclipselink
i made a targetPlatform file, and added eclipselink to this target, and set this target platform as active. then, i imported javax.persistence and eclipselink bundles as dependencies of my plugin.
my persistence.xml is like this
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="ecf" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<properties>
<property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver" />
<property name="javax.persistence.jdbc.url" value="jdbc:postgresql://127.0.0.1:5432/ecf" />
<property name="javax.persistence.jdbc.user" value="postgres" />
<property name="javax.persistence.jdbc.password" value="adminadmin" />
<property name="eclipselink.jdbc.read-connections.min" value="1" />
<property name="eclipselink.jdbc.write-connections.min" value="1" />
<property name="eclipselink.jdbc.batch-writing" value="JDBC" />
<property name="eclipselink.logging.level" value="FINE" />
<property name="eclipselink.logging.thread" value="false" />
<property name="eclipselink.logging.session" value="false" />
<property name="eclipselink.logging.exceptions" value="true" />
<property name="eclipselink.logging.timestamp" value="true" />
</properties>
</persistence-unit>
</persistence>
and made a emf like this
private static EntityManagerFactory emf = null;
private static Map<String, Object> properties = new HashMap<String, Object>();
private static void init() {
properties.put(PersistenceUnitProperties.TARGET_DATABASE, "Derby");
properties.put(PersistenceUnitProperties.JDBC_DRIVER, Driver.class.getCanonicalName());
properties.put(PersistenceUnitProperties.JDBC_URL,"jdbc:postgresql://127.0.0.1:5432/ecf");
properties.put(PersistenceUnitProperties.JDBC_USER, "postgres");
properties.put(PersistenceUnitProperties.JDBC_PASSWORD, "adminadmin");
properties.put(PersistenceUnitProperties.CONNECTION_POOL_MIN, "1");
properties.put(PersistenceUnitProperties.BATCH_WRITING, "JDBC");
properties.put(PersistenceUnitProperties.CLASSLOADER, ECFEntityManager.class.getClassLoader());
properties.put("eclipselink.logging.level", "FINE");
properties.put("eclipselink.logging.timestamp", "false");
properties.put("eclipselink.logging.session", "false");
properties.put("eclipselink.logging.thread", "false");
emf = Persistence.createEntityManagerFactory("ecf",properties);
}
public static EntityManager createEntityManager() {
if (emf == null)
init();
return emf.createEntityManager();
}
but when i try to start the app, the following occours:
org.osgi.framework.BundleException: The activator br.com.german.plugin.Activator for bundle br.com.german.plugin is invalid
at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:171)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:679)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:389)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1130)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
Caused by: javax.persistence.PersistenceException: No Persistence provider for EntityManager named ecf
at javax.persistence.Persistence.createEntityManagerFactory(Unknown Source)
at br.com.german.plugin.entityManager.ECFEntityManager.init(ECFEntityManager.java:33)
at br.com.german.plugin.entityManager.ECFEntityManager.createEntityManager(ECFEntityManager.java:44)
at br.com.german.plugin.Activator.<init>(Activator.java:24)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:166)
... 12 more
what am i missing here?
thanks in advice
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02006 seconds