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

Can't deploy application without persistence

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0.0.A1, 1.0.0.A2
    • Fix Version/s: 1.0.0.M2
    • Component/s: WEB MVC
    • Labels:
      None
    • Environment:
      Java 6
      Maven 2.0.9
      Tomcat 6.0.18

      Description

      I am unable to deploy a simple project without persistence.

      • Create a new project:
        roo> create project -projectName simpleroo -topLevelPackage test
      • Build it with Maven:
        mvn package
      • Deploy it in Tomcat.

      This will result in an exception:

      SCHWERWIEGEND: 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(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:4363)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
      at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830)
      at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:719)
      at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
      at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
      at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
      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.core.StandardService.start(StandardService.java:516)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
      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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
      Caused by: java.lang.ClassNotFoundException: javax.persistence.PersistenceException
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
      ... 32 more

        Issue Links

          Activity

          Hide
          balex Ben Alex added a comment -

          This issue was referred to in the readme.txt that ships with Roo A1 and A2:

          • The web.xml in generated user projects refers to Spring's JPA-
            specific OpenEntityManagerInViewFilter. In the extremely rare case
            you quit the shell after "create project" but before "install jpa"
            (which is the second step if following any sample script or the
            "hint" guidance), you technically have a web.xml requiring a type
            which is not available through a defined pom.xml dependency. As such
            this is a very unlikely to affect anyone pragmatically using Roo. We
            will fix the issue before the next Roo release is made.

          I have assigned this task to Stefan and reassigned it to the WEB MVC component so that Stefan can adjust the template.

          Show
          balex Ben Alex added a comment - This issue was referred to in the readme.txt that ships with Roo A1 and A2: The web.xml in generated user projects refers to Spring's JPA- specific OpenEntityManagerInViewFilter. In the extremely rare case you quit the shell after "create project" but before "install jpa" (which is the second step if following any sample script or the "hint" guidance), you technically have a web.xml requiring a type which is not available through a defined pom.xml dependency. As such this is a very unlikely to affect anyone pragmatically using Roo. We will fix the issue before the next Roo release is made. I have assigned this task to Stefan and reassigned it to the WEB MVC component so that Stefan can adjust the template.
          Hide
          sschmidt Stefan Schmidt added a comment -

          Discussed with Ben and deferred to M2 as related refactoring is pending.

          Show
          sschmidt Stefan Schmidt added a comment - Discussed with Ben and deferred to M2 as related refactoring is pending.
          Hide
          sschmidt Stefan Schmidt added a comment -

          This should be fixed as of rev 134.

          Show
          sschmidt Stefan Schmidt added a comment - This should be fixed as of rev 134.

            People

            • Assignee:
              sschmidt Stefan Schmidt
              Reporter:
              mzeibig Mirko Zeibig
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: