Hi,

 

I have only little experience with Maven. Currently, I'm working on a
project with JPA. It's a desktop application without Application Server. I
added the hibernate-entitymanager-3.4.0.GA.jar to the dependencies (all
corresponding dependencies are resolved by Maven). My JUnit tests concerning
Hibernate and Entities run fine with no errors (so I guess that Maven
principally runs fine).

Unfortunately, I get the an error (see below) when I am creating a jar file
and run the program afterwards. As I can see, of course, the
javax.persistence jar provided by the ejb3-persistence.jar is obviously
missing. But I don't know how to fix the problem. When I'm running the
program as a simple Java Desktop App, everything is fine.

 

If you could provide me any more information, that would be great.

 

Thanks in advance.

 

Martin

 

[INFO] Exception in thread "AWT-EventQueue-0"
java.lang.NoClassDefFoundError: javax/persistence/Persistence

[INFO]      at
de.bamannheim.grademaster.database.DatabaseConnection.<init>(DatabaseConnect
ion.java:32)

[INFO]      at
de.bamannheim.grademaster.database.UserPersistence.loadUser(UserPersistence.
java:86)

[INFO]      at de.bamannheim.grademaster.meta.Session.login(Session.java:84)

[INFO]      at
de.bamannheim.grademaster.gui.Login.myJBtnLoginMouseClicked(Login.java:137)

[INFO]      at de.bamannheim.grademaster.gui.Login.access$2(Login.java:134)

[INFO]      at
de.bamannheim.grademaster.gui.Login$3.mouseClicked(Login.java:76)

[INFO]      at
java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:253)

[INFO]      at java.awt.Component.processMouseEvent(Component.java:6137)

[INFO]      at
javax.swing.JComponent.processMouseEvent(JComponent.java:3265)

[INFO]      at java.awt.Component.processEvent(Component.java:5899)

[INFO]      at java.awt.Container.processEvent(Container.java:2023)

[INFO]      at java.awt.Component.dispatchEventImpl(Component.java:4501)

[INFO]      at java.awt.Container.dispatchEventImpl(Container.java:2081)

[INFO]      at java.awt.Component.dispatchEvent(Component.java:4331)

[INFO]      at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4301)

[INFO]      at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:3974)

[INFO]      at
java.awt.LightweightDispatcher.dispatchEvent(Container.java:3895)

[INFO]      at java.awt.Container.dispatchEventImpl(Container.java:2067)

[INFO]      at java.awt.Window.dispatchEventImpl(Window.java:2458)

[INFO]      at java.awt.Component.dispatchEvent(Component.java:4331)

[INFO]      at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)

[INFO]      at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java
:269)

[INFO]      at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:18
4)

[INFO]      at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java
:174)

[INFO]      at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)

[INFO]      at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)

[INFO]      at
java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

[INFO] Caused by: java.lang.ClassNotFoundException:
javax.persistence.Persistence

[INFO]      at java.net.URLClassLoader$1.run(URLClassLoader.java:200)

[INFO]      at java.security.AccessController.doPrivileged(Native Method)

[INFO]      at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

[INFO]      at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

[INFO]      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

[INFO]      at java.lang.ClassLoader.loadClass(ClassLoader.java:252)

[INFO]      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)

[INFO]      ... 27 more

Reply via email to