java.lang.NoClassDefFoundError: javax/persistence/Persistence


Samebug tips

A few things cause this exception:
1) Check if you have all jars and if they're in the correct path.
2) Your classpath might be broken, you can define it in the command line with java -cp yourClassPath or at your IDE if you're using one.


9 months ago
Expert tip

If you're using Hibernate, this indicates you're missing FasterXML Classmate dependency, which you can add to your dependencies. To add it, the groupId is com.fasterxml and artifactId is Classmate.


7 months ago
Expert tip

Solutions on the web

Solution icon of oraclecommunity
via Oracle Community by Stuart Fleming, 8 months ago
javax/persistence/Persistence

Stack trace

java.lang.NoClassDefFoundError: javax/persistence/Persistence
	at in_jpa_db_objects.JavaServiceFacade.<init>(JavaServiceFacade.java:19)
	at util_import_factory.OraConnInput.OraCleaner(OraConnInput.java:43)
	at startup.startImport.processIncomingXMLs(startImport.java:49)
	at startup.startAll.startupProcesses(startAll.java:92)
	at commandLineStartup.main(commandLineStartup.java:23)
Caused by: java.lang.ClassNotFoundException: javax.persistence.Persistence
	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:305)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:246)
	... 5 more

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Samebug visitor profile picture
Unknown user
2 times, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 2 days ago
Samebug visitor profile picture
Unknown user
Once, 2 days ago
2413 more bugmates