title: Tomcat Restart automatically Web Application on startup, after error
body: <p>I've a big trouble on tomcat.</p>
  
  <p>Before explaine, let me tell is the first time I see something like this...</p>
  
  <p>I'm building an application using JPA on Hibernate, Spring 3.0 and Jersey REST Framework.</p>
  
  <p>When using glassfish, everything works fine, but deployng the same application on tomcat, I registered the following error code:</p>
  
  <pre><code>    GRAVE: Error deploying configuration descriptor java-zero.xml
  java.lang.NoClassDefFoundError: com/sun/jersey/spi/container/servlet/ServletContainer
          at java.lang.ClassLoader.defineClass1(Native Method)
          at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
          at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
          at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
          at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2527)
          at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1010)
          at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1483)
          at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
          at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1095)
          at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
          at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4187)
          at org.apache.catalina.core.StandardContext.start(StandardContext.java:4496)
          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:546)
          at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)
          at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)
          at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)
          at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
          at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
          at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
          at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
          at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
          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:519)
          at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
          at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
          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:289)
          at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
  Caused by: java.lang.ClassNotFoundException: com.sun.jersey.spi.container.servlet.ServletContainer
          at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1516)
          at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1361)
          ... 34 more
  </code></pre>
  
  <p>Then tomcat restarts the application and again, the same error. In an infinite loop.</p>
  
  <p>Looks like a library conflict, but I really don't have any ideas on how to solve it...</p>
  
  <p>Any suggestion is appreciated!</p>
  
  <p>Ciao, Davide.</p>