title: Tomcat ClassNotFound exception when trying to run Application
body: <p>I have a grails application that I was running fine until yesterday when I decided to download an Email plugin into the STS. The download failed for some reason and I got around the issue with a few searches around. Once I resolved the plugin issues, my application stopped to work. I tried a lot of things including re-installing STS. I was maintaining a GIT repository and I reverted all my changes to the last known working one. This did not help either. I created a new Grails project and copied all my source files over there and everything was working fine.</p>
  
  <p>I compared all the build paths and properties files between the working one and the non working one and they seem to be the same except the .classpath which is getting changed every time I try to run the application like the below</p>
  
  <pre><code>+       &lt;classpathentry exported="true" kind="con" path="GROOVY_DSL_SUPPORT"/&gt;
          &lt;classpathentry kind="con" path="com.springsource.sts.grails.core.CLASSP
  -       &lt;classpathentry kind="src" path=".link_to_grails_plugins/tomcat-1.3.7/sr
  -               &lt;attributes&gt;
  -                       &lt;attribute name="com.springsource.sts.grails.core.SOURCE
  -               &lt;/attributes&gt;
  -       &lt;/classpathentry&gt;
  </code></pre>
  
  <p>Can anyone please help me with where I should be looking to get this application back on track??</p>
  
  <p>Here is the Error that I get:</p>
  
  <pre><code>    Welcome to Grails 1.3.7 - http://grails.org/
  Licensed under Apache Standard License 2.0
  Grails home is set to: /Users/mymac/springsource/grails-1.3.7/
  Base Directory: /Users/mymac/MyProjects/MyGitSources/books_grails/books
  Resolving dependencies...
  Dependencies resolved in 862ms.
  Running script /Users/mymac/springsource/grails-1.3.7/scripts/RunApp.groovy
  Environment set to development
       [copy] Copying 1 file to /Users/mymac/.grails/1.3.7/projects/books
  WARNING: No default container found, installing Tomcat..
  Resolving plugin tomcat. Please wait...
  Error executing script RunApp: java.lang.ClassNotFoundException: org.grails.tomcat.TomcatServerFactory
  java.lang.ClassNotFoundException: org.grails.tomcat.TomcatServerFactory
      at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:391)
      at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
      at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
      at gant.Gant.withBuildListeners(Gant.groovy:427)
      at gant.Gant.this$2$withBuildListeners(Gant.groovy)
      at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
      at gant.Gant.dispatch(Gant.groovy:415)
      at gant.Gant.this$2$dispatch(Gant.groovy)
      at gant.Gant.invokeMethod(Gant.groovy)
      at gant.Gant.executeTargets(Gant.groovy:590)
      at gant.Gant.executeTargets(Gant.groovy:589)
  Caused by: java.lang.ClassNotFoundException: org.grails.tomcat.TomcatServerFactory
      at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      at java_lang_ClassLoader$loadClass.call(Unknown Source)
      at _GrailsRun_groovy$_loadServerFactory_closure11.doCall(_GrailsRun_groovy:85)
      at _GrailsRun_groovy.loadServerFactory(_GrailsRun_groovy:101)
      at _GrailsRun_groovy.this$4$loadServerFactory(_GrailsRun_groovy)
      at _GrailsRun_groovy$this$4$loadServerFactory.callCurrent(Unknown Source)
      at _GrailsRun_groovy.runInline(_GrailsRun_groovy:114)
      at _GrailsRun_groovy.this$4$runInline(_GrailsRun_groovy)
      at _GrailsRun_groovy$_run_closure1.doCall(_GrailsRun_groovy:59)
      at RunApp$_run_closure1.doCall(RunApp:33)
      at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
      ... 10 more
  --- Nested Exception ---
  java.lang.ClassNotFoundException: org.grails.tomcat.TomcatServerFactory
      at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
      at java_lang_ClassLoader$loadClass.call(Unknown Source)
      at _GrailsRun_groovy$_loadServerFactory_closure11.doCall(_GrailsRun_groovy:85)
      at _GrailsRun_groovy.loadServerFactory(_GrailsRun_groovy:101)
      at _GrailsRun_groovy.this$4$loadServerFactory(_GrailsRun_groovy)
      at _GrailsRun_groovy$this$4$loadServerFactory.callCurrent(Unknown Source)
      at _GrailsRun_groovy.runInline(_GrailsRun_groovy:114)
      at _GrailsRun_groovy.this$4$runInline(_GrailsRun_groovy)
      at _GrailsRun_groovy$_run_closure1.doCall(_GrailsRun_groovy:59)
      at RunApp$_run_closure1.doCall(RunApp:33)
      at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
      at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
      at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
      at gant.Gant.withBuildListeners(Gant.groovy:427)
      at gant.Gant.this$2$withBuildListeners(Gant.groovy)
      at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
      at gant.Gant.dispatch(Gant.groovy:415)
      at gant.Gant.this$2$dispatch(Gant.groovy)
      at gant.Gant.invokeMethod(Gant.groovy)
      at gant.Gant.executeTargets(Gant.groovy:590)
      at gant.Gant.executeTargets(Gant.groovy:589)
  Error executing script RunApp: java.lang.ClassNotFoundException: org.grails.tomcat.TomcatServerFactory
  </code></pre>
  
  <p>[UPDATE]:</p>
  
  <p>When I tried to install the mail plugin in my new working project again, The same error is reproduced if I try to run my application. Somehow the plugin is screwing up my application. Now I don't know how the plugins are installed and what they change in a project :-(</p>
  
  <p>Thanks!!</p>