java.lang.NoClassDefFoundError: javax/persistence/PersistenceException

liquibase.org | 5 months ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to rafael and Rafael Fischer Viola . Or join the community to write better ones.
  1. 0

    Cannot get diff against Hibernate to work in ant - Liquibase Forums

    liquibase.org | 5 months ago
    java.lang.NoClassDefFoundError: javax/persistence/PersistenceException
  2. 0
    samebug tip
    This was caused by a failure to instantiate Kafka broker. Check your dependencies.
  3. 0
    samebug tip
    This exception normally means you either have to add the said class to your dependencies or you miswrote it. Look in the documentation of your library how to add it as a dependency.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0
    samebug tip
    If you're using Hibernate, this indicates you're missing FasterXML Classmate dependency, which you can add with the following: <groupId>com.fasterxml</groupId> <artifactId>classmate</artifactId> <version>1.0</version>
  6. 0
    samebug tip
    NoClassDefFoundError means java has failed to find a class you're trying to instantiate, look if you've added the class you're trying to instantiate to the dependencies.
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.ClassNotFoundException

    javax.persistence.PersistenceException

    at java.net.URLClassLoader$1.run()
  2. Java RT
    ClassLoader.loadClass
    1. java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    2. java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    3. java.security.AccessController.doPrivileged(Native Method)
    4. java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    5. java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    6. sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    7. java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    7 frames
  3. liquibase.ext.hibernate
    HibernateDatabase.setConnection
    1. liquibase.ext.hibernate.database.HibernateEjb3Database.buildConfigurationFromFile(HibernateEjb3Database.java:76)
    2. liquibase.ext.hibernate.database.HibernateEjb3Database.buildConfiguration(HibernateEjb3Database.java:28)
    3. liquibase.ext.hibernate.database.HibernateDatabase.setConnection(HibernateDatabase.java:44)
    3 frames
  4. Liquibase Core
    BaseLiquibaseTask.execute
    1. liquibase.database.DatabaseFactory.findCorrectDatabaseImplementation(DatabaseFactory.java:123)
    2. liquibase.integration.ant.type.DatabaseType.createDatabase(DatabaseType.java:82)
    3. liquibase.integration.ant.BaseLiquibaseTask.createDatabaseFromType(BaseLiquibaseTask.java:96)
    4. liquibase.integration.ant.AbstractDatabaseDiffTask.getDiffResult(AbstractDatabaseDiffTask.java:24)
    5. liquibase.integration.ant.DiffDatabaseToChangeLogTask.executeWithLiquibaseClassloader(DiffDatabaseToChangeLogTask.java:44)
    6. liquibase.integration.ant.BaseLiquibaseTask.execute(BaseLiquibaseTask.java:81)
    6 frames
  5. Ant
    UnknownElement.execute
    1. org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
    1 frame
  6. Java RT
    Method.invoke
    1. sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
    2. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    3. java.lang.reflect.Method.invoke(Method.java:606)
    3 frames
  7. Ant
    DefaultExecutor.executeTargets
    1. org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    2. org.apache.tools.ant.Task.perform(Task.java:348)
    3. org.apache.tools.ant.Target.execute(Target.java:392)
    4. org.apache.tools.ant.Target.performTasks(Target.java:413)
    5. org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
    6. org.apache.tools.ant.Project.executeTarget(Project.java:1368)
    7. org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    7 frames
  8. org.eclipse.ant
    EclipseDefaultExecutor.executeTargets
    1. org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
    1 frame
  9. Ant
    Project.executeTargets
    1. org.apache.tools.ant.Project.executeTargets(Project.java:1251)
    1 frame
  10. org.eclipse.ant
    InternalAntRunner.main
    1. org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:424)
    2. org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:138)
    2 frames