[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] PersistenceException: No Persistence provider for EntityManager named

Hi,

i currently think about using EclipseLink as my prefered Persistence
Framework for my next Eclipse App.

I tried to setup a first example using the following guide: 
http://wiki.eclipse.org/EclipseLink/Examples/JPA/RCP
http://wiki.eclipse.org/EclipseLink/Examples/JPA/RCP 

I put all EclipseLink Osgi Plugins into my Plugin Folder and added them to
one new Feature.

Next step was writing the persistence.xml which looks like the following:

<persistence-unit name="test">
		<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
		<properties>
			<property name="eclipselink.jdbc.driver"
value="org.apache.derby.jdbc.ClientDriver"/>
			<property name="eclipselink.jdbc.url"
value="jdbc:derby://localhost:1527/sample;create=true"/>
			<property name="eclipselink.jdbc.user" value="app"/>
			<property name="eclipselink.jdbc.password" value="app"/>
			<property name="eclipselink.ddl-generation"
value="drop-and-create-tables"/>
			<property name="eclipselink.ddl-generation.output-mode"
value="database"/>
 
			<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" />
 
			<!-- Logging -->
			<property name="eclipselink.logging.level" value="FINE" />
			<property name="eclipselink.logging.timestamp" value="false" />
			<property name="eclipselink.logging.session" value="false" />
			<property name="eclipselink.logging.thread" value="false" />
		</properties>
 
	</persistence-unit>

Every Time when i try to start my App i got the following Exception:

javax.persistence.PersistenceException: No Persistence provider for
EntityManager named test
	at
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:129)
	at
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:99)
	at
net.sf.emc2.core.persistence.CorePersistencePlugin.start(CorePersistencePlugin.java:39)
	at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:1009)
	at java.security.AccessController.doPrivileged(Native Method)
	at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:1003)
	at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:984)
	at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:346)
	at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:265)
	at
org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:400)
	at
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:111)
	at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:427)
	at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:193)
	at
org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:368)
	at
org.eclipse.osgi.framework.internal.core.SingleSourcePackage.loadClass(SingleSourcePackage.java:33)
	at
org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:441)
	at
org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:397)
	at
org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:385)
	at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:87)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
	at
net.sf.emc2.mail.ui.MailPerspective.createInitialLayout(MailPerspective.java:15)
	at
org.eclipse.ui.internal.Perspective.loadPredefinedPersp(Perspective.java:801)
	at
org.eclipse.ui.internal.Perspective.createPresentation(Perspective.java:259)
	at org.eclipse.ui.internal.Perspective.<init>(Perspective.java:147)
	at
org.eclipse.ui.internal.tweaklets.Workbench3xImplementation.createPerspective(Workbench3xImplementation.java:55)
	at
org.eclipse.ui.internal.WorkbenchPage.createPerspective(WorkbenchPage.java:1633)
	at org.eclipse.ui.internal.WorkbenchPage.init(WorkbenchPage.java:2414)
	at org.eclipse.ui.internal.WorkbenchPage.<init>(WorkbenchPage.java:560)
	at
org.eclipse.ui.internal.tweaklets.Workbench3xImplementation.createWorkbenchPage(Workbench3xImplementation.java:39)
	at
org.eclipse.ui.internal.WorkbenchWindow.busyOpenPage(WorkbenchWindow.java:756)
	at
org.eclipse.ui.internal.Workbench$21.runWithException(Workbench.java:1027)
	at
org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:133)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3378)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3036)
	at
org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:803)
	at
org.eclipse.ui.internal.Workbench$27.runWithException(Workbench.java:1361)
	at
org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:178)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:4021)
	at
org.eclipse.ui.internal.StartupThreading.runWithoutExceptions(StartupThreading.java:94)
	at org.eclipse.ui.internal.Workbench.init(Workbench.java:1356)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2312)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
	at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
	at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at
net.sf.emc2.core.ui.EclipseMessagingClient.start(EclipseMessagingClient.java:20)
	at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
	at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
	at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1212)

!ENTRY org.eclipse.osgi 4 0 2008-08-23 14:08:18.681
!MESSAGE Application error
!STACK 1
java.lang.NoClassDefFoundError:
net/sf/emc2/core/persistence/CorePersistencePlugin
	at
net.sf.emc2.mail.ui.MailPerspective.createInitialLayout(MailPerspective.java:15)
	at
org.eclipse.ui.internal.Perspective.loadPredefinedPersp(Perspective.java:801)
	at
org.eclipse.ui.internal.Perspective.createPresentation(Perspective.java:259)
	at org.eclipse.ui.internal.Perspective.<init>(Perspective.java:147)
	at
org.eclipse.ui.internal.tweaklets.Workbench3xImplementation.createPerspective(Workbench3xImplementation.java:55)
	at
org.eclipse.ui.internal.WorkbenchPage.createPerspective(WorkbenchPage.java:1633)
	at org.eclipse.ui.internal.WorkbenchPage.init(WorkbenchPage.java:2414)
	at org.eclipse.ui.internal.WorkbenchPage.<init>(WorkbenchPage.java:560)
	at
org.eclipse.ui.internal.tweaklets.Workbench3xImplementation.createWorkbenchPage(Workbench3xImplementation.java:39)
	at
org.eclipse.ui.internal.WorkbenchWindow.busyOpenPage(WorkbenchWindow.java:756)
	at
org.eclipse.ui.internal.Workbench$21.runWithException(Workbench.java:1027)
	at
org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:133)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3378)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3036)
	at
org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:803)
	at
org.eclipse.ui.internal.Workbench$27.runWithException(Workbench.java:1361)
	at
org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:178)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:4021)
	at
org.eclipse.ui.internal.StartupThreading.runWithoutExceptions(StartupThreading.java:94)
	at org.eclipse.ui.internal.Workbench.init(Workbench.java:1356)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2312)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
	at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
	at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at
net.sf.emc2.core.ui.EclipseMessagingClient.start(EclipseMessagingClient.java:20)
	at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
	at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
	at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:616)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by:
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException:
An error occurred while automatically activating bundle
net.sf.emc2.core.persistence (51).
	at
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:125)
	at
org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:427)
	at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:193)
	at
org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:368)
	at
org.eclipse.osgi.framework.internal.core.SingleSourcePackage.loadClass(SingleSourcePackage.java:33)
	at
org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:441)
	at
org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:397)
	at
org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:385)
	at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:87)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
	... 44 more
Caused by: org.osgi.framework.BundleException: Exception in
net.sf.emc2.core.persistence.CorePersistencePlugin.start() of bundle
net.sf.emc2.core.persistence.
	at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:1028)
	at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:984)
	at
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:346)
	at
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:265)
	at
org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:400)
	at
org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:111)
	... 54 more
Caused by: javax.persistence.PersistenceException: No Persistence provider
for EntityManager named test
	at
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:129)
	at
javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:99)
	at
net.sf.emc2.core.persistence.CorePersistencePlugin.start(CorePersistencePlugin.java:39)
	at
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:1009)
	at java.security.AccessController.doPrivileged(Native Method)
	at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:1003)
	... 59 more

!ENTRY org.eclipse.osgi 2 0 2008-08-23 14:08:18.718
!MESSAGE The following is a complete list of bundles which are not resolved,
see the prior log entry for the root cause if it exists:
!SUBENTRY 1 org.eclipse.osgi 2 0 2008-08-23 14:08:18.718
!MESSAGE Bundle
reference:file:/opt/eclipse-rcp/plugins/javax.xml.rpc_1.1.0.v200706111329/
[13] was not resolved.
!SUBENTRY 2 javax.xml.rpc 2 0 2008-08-23 14:08:18.718
!MESSAGE Missing optionally required bundle org.apache.xerces_[2.8.0,3.0.0).

It would be great if someone out ther could help me finding my mistake.

Kind regards

Andreas

-- 
View this message in context: http://www.nabble.com/PersistenceException%3A-No-Persistence-provider-for-EntityManager-named-tp19121098p19121098.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.