runnable jar cannot load persistence.xml [message #519206] |
Sun, 07 March 2010 21:15  |
Eclipse User |
|
|
|
I developed an application that uses JPA (eclipse-link) and connects to a MySQL database. The application works as expected when run from eclipse. However when I export the project as a runnable jar I encounter problems when I run the application. It appears that the persistence.xml file could not be loaded.
I also do not have any problems if I extract the contents of the jar and execute the application.
I execute the application from the command line using the following command:
java -jar pivotmenu.jar
Does the persistence.xml file have to be specified in the MANIFEST.MF file?
This is the content of the MANIFEST.MF file.
Manifest-Version: 1.0
Rsrc-Class-Path: ./ pivot-core-1.4.jar pivot-tools-1.4.jar org.eclipse
.persistence.core_1.1.2.v20090612-r4475.jar org.eclipse.persistence.a
sm_1.1.2.v20090612-r4475.jar mysql-connector-java-5.1.5-bin.jar pivot
-wtk-terra-1.4.jar javax.persistence_1.99.0.v200906021518.jar pivot-w
tk-1.4.jar org.eclipse.persistence.antlr_1.1.2.v20090612-r4475.jar or
g.eclipse.persistence.jpa_1.1.2.v20090612-r4475.jar
Class-Path: .
Rsrc-Main-Class: com.ilagan.pivot.MenuButtons
Main-Class: org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader
This is the exception that is thrown
Mar 7, 2010 1:07:49 PM java.util.prefs.FileSystemPreferences$2 run
INFO: Created user preferences directory.
java.lang.RuntimeException: Exception [EclipseLink-30005] (Eclipse Persistence Services - 1.1.2.v20090612-r4475): org.eclipse.persistence.exceptions.PersistenceUnitLoadingExc eption
Exception Description: An exception was thrown while searching for persistence archives with ClassLoader: java.net.URLClassLoader@ca0b6
Internal Exception: Exception [EclipseLink-30004] (Eclipse Persistence Services - 1.1.2.v20090612-r4475): org.eclipse.persistence.exceptions.PersistenceUnitLoadingExc eption
Exception Description: An exception was thrown while processing persistence.xml from URL: rsrc:../
Internal Exception: java.net.MalformedURLException
at com.ilagan.pivot.MenuButtons.<init>(MenuButtons.java:66)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ e Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Native ConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De legatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:5 32)
at java.lang.Class.newInstance0(Class.java:372)
at java.lang.Class.newInstance(Class.java:325)
at org.apache.pivot.wtk.DesktopApplicationContext$HostFrame.pro cessWindowEvent(Unknown Source)
at java.awt.Window.processEvent(Window.java:1823)
at java.awt.Component.dispatchEventImpl(Component.java:4469)
at java.awt.Container.dispatchEventImpl(Container.java:2163)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4295)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:604)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDis patchThread.java:275)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispat chThread.java:200)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDis patchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread. java:185)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread. java:177)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:13 8)
Caused by: Exception [EclipseLink-30005] (Eclipse Persistence Services - 1.1.2.v20090612-r4475): org.eclipse.persistence.exceptions.PersistenceUnitLoadingExc eption
Exception Description: An exception was thrown while searching for persistence archives with ClassLoader: java.net.URLClassLoader@ca0b6
Internal Exception: Exception [EclipseLink-30004] (Eclipse Persistence Services - 1.1.2.v20090612-r4475): org.eclipse.persistence.exceptions.PersistenceUnitLoadingExc eption
Any assistance would be much appreciated.
Thanks,
Frank
|
|
|
|
Powered by
FUDForum. Page generated in 0.03289 seconds