Uploaded image for project: 'Spring Roo'
  1. Spring Roo
  2. ROO-58

Application without installing JPA gives error (java.lang.NoClassDefFoundError: javax/persistence/PersistenceException)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.0.0.M1
    • Fix Version/s: 1.0.0.M2
    • Component/s: PERSISTENCE
    • Labels:
      None

      Description

      >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

        Issue Links

          Activity

          Hide
          balex Ben Alex added a comment -

          Reported in ROO-54; please take a look in there for the full details. A workaround is available by typing (within the Roo shell):

          add dependency -groupId javax.annotation -artifactId jsr250-api -version 1.0

          Show
          balex Ben Alex added a comment - Reported in ROO-54 ; please take a look in there for the full details. A workaround is available by typing (within the Roo shell): add dependency -groupId javax.annotation -artifactId jsr250-api -version 1.0
          Hide
          balex Ben Alex added a comment -

          Fixed in original issue, ROO-54.

          Show
          balex Ben Alex added a comment - Fixed in original issue, ROO-54 .

            People

            • Assignee:
              balex Ben Alex
              Reporter:
              marceloverdijk Marcel Overdijk
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: