java.lang.NoClassDefFoundError: javax/persistence/PersistenceException

tip

This means you're missing a class that Java needs for this program. Check if you're not missing the jsr305-1.3.7.jar from your classpath, it's the jar that contains the class javax.annotation.Nullable.

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

  • >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
    via by Marcel Overdijk,
  • >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
    via by Marcel Overdijk,
  • webapp start fail on tomcat6
    via Stack Overflow by AhAd
    ,
    • 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(ApplicationFilterConfig.java:255) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397) at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4356) 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(AbstractRunMojo.java:385) at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java:144) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:553) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:523) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.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(DelegatingMethodAccessorImpl.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(WebappClassLoader.java:1360) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 35 more

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    444 more bugmates