java.lang.NoClassDefFoundError: javax/persistence/PersistenceException

Spring JIRA | Marcel Overdijk | 8 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    >mkdir testapp >cd testapp >roo ____ ____ ____ / __ \/ __ \/ __ \ / /_/ / / / / / / / / _, _/ /_/ / /_/ / /_/ |_|\____/\____/ 1.0.0.M1 [rev 64] roo> create project -topLevelPackage org.testapp roo> exit > mvn tomcat-run [INFO] Scanning for projects... [INFO] artifact org.codehaus.mojo:tomcat-maven-plugin: checking for updates from jboss-plugins [INFO] artifact org.codehaus.mojo:tomcat-maven-plugin: checking for updates from jboss-snapshot-plugins [INFO] ------------------------------------------------------------------------ [INFO] Building testapp [INFO] task-segment: [tomcat:run] [INFO] ------------------------------------------------------------------------ [INFO] Preparing tomcat:run [INFO] [aspectj:compile {execution: default}] [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:compile] [INFO] Nothing to compile - all classes are up to date [INFO] [tomcat:run] [INFO] Running war on http://localhost:8080/testapp [INFO] Creating Tomcat server configuration at D:\Spring\projects\testapp\target \tomcat 29-mei-2009 20:50:09 org.apache.catalina.startup.Embedded start INFO: Starting tomcat server 29-mei-2009 20:50:10 org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.16 29-mei-2009 20:50:11 org.apache.catalina.core.StandardContext addApplicationList ener INFO: The listener "org.springframework.web.context.ContextLoaderListener" is al ready configured for this context. The duplicate definition has been ignored. 29-mei-2009 20:50:11 org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring root WebApplicationContext log4j:WARN No appenders could be found for logger (org.springframework.web.conte xt.ContextLoader). log4j:WARN Please initialize the log4j system properly. 29-mei-2009 20:50:12 org.apache.catalina.core.StandardContext filterStart SEVERE: Exception starting filter Spring OpenEntityManagerInViewFilter java.lang.NoClassDefFoundError: javax/persistence/PersistenceException at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389) at java.lang.Class.getConstructor0(Class.java:2699) at java.lang.Class.newInstance0(Class.java:326) at java.lang.Class.newInstance(Class.java:308) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(Applicatio nFilterConfig.java:255) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(Applica tionFilterConfig.java:397) at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFi lterConfig.java:108) at org.apache.catalina.core.StandardContext.filterStart(StandardContext. java:3709) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4 356) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443 ) at org.apache.catalina.startup.Embedded.start(Embedded.java:825) at org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunMo jo.java:385) at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java :144) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi nManager.java:483) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa ultLifecycleExecutor.java:678) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone Goal(DefaultLifecycleExecutor.java:553) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau ltLifecycleExecutor.java:523) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan dleFailures(DefaultLifecycleExecutor.java:371) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen ts(DefaultLifecycleExecutor.java:332) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi fecycleExecutor.java:181) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137) at org.apache.maven.cli.MavenCli.main(MavenCli.java:356) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by: java.lang.ClassNotFoundException: javax.persistence.PersistenceExcept ion at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa der.java:1360) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa der.java:1206) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 35 more 29-mei-2009 20:50:12 org.apache.catalina.core.ApplicationContext log INFO: org.tuckey.web.filters.urlrewrite.UrlRewriteFilter INFO: loaded (conf ok) 29-mei-2009 20:50:12 org.apache.catalina.core.StandardContext start SEVERE: Error filterStart 29-mei-2009 20:50:12 org.apache.catalina.core.StandardContext start SEVERE: Context [/testapp] startup failed due to previous errors 29-mei-2009 20:50:12 org.apache.catalina.core.ApplicationContext log INFO: org.tuckey.web.filters.urlrewrite.UrlRewriteFilter INFO: destroy called 29-mei-2009 20:50:12 org.apache.catalina.core.ApplicationContext log INFO: Closing Spring root WebApplicationContext 29-mei-2009 20:50:12 org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 29-mei-2009 20:50:12 org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8080

    Spring JIRA | 8 years ago | Marcel Overdijk
    java.lang.NoClassDefFoundError: javax/persistence/PersistenceException
  2. 0

    >mkdir testapp >cd testapp >roo ____ ____ ____ / __ \/ __ \/ __ \ / /_/ / / / / / / / / _, _/ /_/ / /_/ / /_/ |_|\____/\____/ 1.0.0.M1 [rev 64] roo> create project -topLevelPackage org.testapp roo> exit > mvn tomcat-run [INFO] Scanning for projects... [INFO] artifact org.codehaus.mojo:tomcat-maven-plugin: checking for updates from jboss-plugins [INFO] artifact org.codehaus.mojo:tomcat-maven-plugin: checking for updates from jboss-snapshot-plugins [INFO] ------------------------------------------------------------------------ [INFO] Building testapp [INFO] task-segment: [tomcat:run] [INFO] ------------------------------------------------------------------------ [INFO] Preparing tomcat:run [INFO] [aspectj:compile {execution: default}] [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:compile] [INFO] Nothing to compile - all classes are up to date [INFO] [tomcat:run] [INFO] Running war on http://localhost:8080/testapp [INFO] Creating Tomcat server configuration at D:\Spring\projects\testapp\target \tomcat 29-mei-2009 20:50:09 org.apache.catalina.startup.Embedded start INFO: Starting tomcat server 29-mei-2009 20:50:10 org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.16 29-mei-2009 20:50:11 org.apache.catalina.core.StandardContext addApplicationList ener INFO: The listener "org.springframework.web.context.ContextLoaderListener" is al ready configured for this context. The duplicate definition has been ignored. 29-mei-2009 20:50:11 org.apache.catalina.core.ApplicationContext log INFO: Initializing Spring root WebApplicationContext log4j:WARN No appenders could be found for logger (org.springframework.web.conte xt.ContextLoader). log4j:WARN Please initialize the log4j system properly. 29-mei-2009 20:50:12 org.apache.catalina.core.StandardContext filterStart SEVERE: Exception starting filter Spring OpenEntityManagerInViewFilter java.lang.NoClassDefFoundError: javax/persistence/PersistenceException at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389) at java.lang.Class.getConstructor0(Class.java:2699) at java.lang.Class.newInstance0(Class.java:326) at java.lang.Class.newInstance(Class.java:308) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(Applicatio nFilterConfig.java:255) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(Applica tionFilterConfig.java:397) at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFi lterConfig.java:108) at org.apache.catalina.core.StandardContext.filterStart(StandardContext. java:3709) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4 356) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:719) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443 ) at org.apache.catalina.startup.Embedded.start(Embedded.java:825) at org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunMo jo.java:385) at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java :144) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi nManager.java:483) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa ultLifecycleExecutor.java:678) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone Goal(DefaultLifecycleExecutor.java:553) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau ltLifecycleExecutor.java:523) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan dleFailures(DefaultLifecycleExecutor.java:371) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen ts(DefaultLifecycleExecutor.java:332) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi fecycleExecutor.java:181) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137) at org.apache.maven.cli.MavenCli.main(MavenCli.java:356) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by: java.lang.ClassNotFoundException: javax.persistence.PersistenceExcept ion at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa der.java:1360) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoa der.java:1206) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 35 more 29-mei-2009 20:50:12 org.apache.catalina.core.ApplicationContext log INFO: org.tuckey.web.filters.urlrewrite.UrlRewriteFilter INFO: loaded (conf ok) 29-mei-2009 20:50:12 org.apache.catalina.core.StandardContext start SEVERE: Error filterStart 29-mei-2009 20:50:12 org.apache.catalina.core.StandardContext start SEVERE: Context [/testapp] startup failed due to previous errors 29-mei-2009 20:50:12 org.apache.catalina.core.ApplicationContext log INFO: org.tuckey.web.filters.urlrewrite.UrlRewriteFilter INFO: destroy called 29-mei-2009 20:50:12 org.apache.catalina.core.ApplicationContext log INFO: Closing Spring root WebApplicationContext 29-mei-2009 20:50:12 org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 29-mei-2009 20:50:12 org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8080

    Spring JIRA | 8 years ago | Marcel Overdijk
    java.lang.NoClassDefFoundError: javax/persistence/PersistenceException
  3. 0

    Basic Spring MVC web app causes "ContextLoaderListener" error

    Stack Overflow | 5 years ago | phil-opp
    java.lang.NoClassDefFoundError: org/springframework/context/ConfigurableApplicationContext
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    SpringSource Tool Suite - can't run a Spring Template Project

    Stack Overflow | 5 years ago | Leirith
    java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContextException
  6. 0

    webapp start fail on tomcat6

    Stack Overflow | 4 years ago | AhAd
    java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at org.ambraproject.configuration.WebAppListener.&lt;clinit&gt;(WebAppListener.java:40)
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.PersistenceExcept ion

    at org.apache.catalina.loader.WebappClassLoader.loadClass()
  2. Glassfish Core
    WebappClassLoader.loadClass
    1. org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360)
    2. org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)
    2 frames
  3. Java RT
    Class.newInstance
    1. java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
    2. java.lang.Class.getDeclaredConstructors0(Native Method)
    3. java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
    4. java.lang.Class.getConstructor0(Class.java:2699)
    5. java.lang.Class.newInstance0(Class.java:326)
    6. java.lang.Class.newInstance(Class.java:308)
    6 frames
  4. Glassfish Core
    Embedded.start
    1. org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:255)
    2. org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
    3. org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
    4. org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709)
    5. org.apache.catalina.core.StandardContext.start(StandardContext.java:4356)
    6. org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    7. org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
    8. org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    9. org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    10. org.apache.catalina.startup.Embedded.start(Embedded.java:825)
    10 frames
  5. org.codehaus.mojo
    AbstractRunMojo.execute
    1. org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunMojo.java:385)
    2. org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java:144)
    2 frames
  6. Maven Plugin
    DefaultPluginManager.executeMojo
    1. org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
    1 frame
  7. Maven Core
    DefaultMaven.execute
    1. org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
    2. org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:553)
    3. org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:523)
    4. org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
    5. org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
    6. org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
    7. org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
    8. org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
    8 frames
  8. M3 Interceptor
    MavenCli.main
    1. org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
    1 frame
  9. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    4. java.lang.reflect.Method.invoke(Method.java:597)
    4 frames
  10. Plexus
    Launcher.main
    1. org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    2. org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    3. org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    4. org.codehaus.classworlds.Launcher.main(Launcher.java:375)
    4 frames