title: Grails app deploy in Tomcat server using WAR file fails
body: <p>I have a Grails (2.3.6) application that needs to be deployed in a Tomcat server for remote user access.</p>
  
  <p>Right now we have local servers that are running from with in Grails and it all works great. Now the purpose to deploy it in Tomcat is to do that with a WAR file. So that our source files are not going into a remote server.</p>
  
  <p>So as the 1st step i created a WAR file of my app using the command:</p>
  
  <pre><code>grails prod war
  </code></pre>
  
  <p>This created a WAR file in the root project directory.</p>
  
  <p>The version of Tomcat i am using is:</p>
  
  <pre><code>apache-tomcat-7.0.57
  </code></pre>
  
  <p>I went to apache-tomcat-7.0.57\conf folder and edited the server.xml file.</p>
  
  <pre><code> &lt;Connector port="8181" protocol="HTTP/1.1"
             connectionTimeout="20000"
             redirectPort="8443" /&gt;
  &lt;!-- A "Connector" using the shared thread pool--&gt;
  &lt;!--
  &lt;Connector executor="tomcatThreadPool"
             port="8181" protocol="HTTP/1.1"
             connectionTimeout="20000"
             redirectPort="8443" /&gt;
  --&gt;
  </code></pre>
  
  <p>The only change i made here is to put a new port.</p>
  
  <p>And in the apache-tomcat-7.0.57\webapps folder i placed the WAR file.</p>
  
  <pre><code>TDProxyServer-1.2.5.war
  </code></pre>
  
  <p>And i ran the startup.bat file in apache-tomcat-7.0.57\bin</p>
  
  <p>This now created a TDProxyServer-1.2.5 folder in the webapps.</p>
  
  <p>Now go to browser and typed in the URL:</p>
  
  <pre><code>http://localhost:8181/TDProxyServer-1.2.5/
  </code></pre>
  
  <p>It basically brings up a blank page. I look at the folder apache-tomcat-7.0.57\webapps\TDProxyServer-1.2.5 and see the following folders.</p>
  
  <pre><code>css
  extensions
  images
  js
  META-INF
  plugins
  WEB-INF
  </code></pre>
  
  <p>This is the 1st time am deploying in Tomcat and have no idea what am doing wrong here. </p>
  
  <p>Can anyone guide me through the process of deploying a Grails WAR file in a Tomcat server?</p>
  
  <p>I appreciate your earliest response on this.</p>
  
  <p><strong>Updated:</strong></p>
  
  <p>I tried per what <strong>Jeff</strong> suggested and that doesn't work.</p>
  
  <p>I opened the Tomcat manager and see that the deployment is failing with the message:</p>
  
  <pre><code>Message:    FAIL - Application at context path /TDProxyServer-1.2.5 could not be started
  </code></pre>
  
  <p>I don't see any error message when starting up the Tomcat server.</p>
  
  <p><strong>Updated</strong></p>
  
  <p>Per <strong>cfrick's</strong> suggestion i looked at the log files in     apache-tomcat-7.0.57\logs directory. </p>
  
  <p>There're 5 log files in this directory.</p>
  
  <pre><code>catalina.2014-12-19
  host-manager.2014-12-19
  localhost.2014-12-19
  localhost_access_log.2014-12-19
  manager.2014-12-19
  </code></pre>
  
  <p>When i first startup the Tomcat server, the catalina.2014-12-19.log has all info about the start up process and there are following error messages at this point printed in startup.bat console window.</p>
  
  <pre><code>INFO: Deploying web application archive C:\Users\me\Downloads\apache-tomcat-7.
  0.57-windows-x64\apache-tomcat-7.0.57\webapps\TDProxyServer-1.2.5.war
  Dec 19, 2014 11:36:51 AM org.apache.catalina.core.StandardContext startInternal
  SEVERE: Error listenerStart
  Dec 19, 2014 11:36:51 AM org.apache.catalina.core.StandardContext startInternal
  SEVERE: Context [/TDProxyServer-1.2.5] startup failed due to previous errors
  Dec 19, 2014 11:36:51 AM org.apache.catalina.startup.HostConfig deployWAR
  INFO: Deployment of web application archive C:\Users\me\Downloads\apache-tomca
  t-7.0.57-windows-x64\apache-tomcat-7.0.57\webapps\TDProxyServer-1.2.5.war has finishe
  d in 39,295 ms
  </code></pre>
  
  <p>Now i go to Tomcat Manager and see that TDProxyServer-1.2.5 has still not be started and the <strong>start</strong> button is active.</p>
  
  <p>I click on start button and it adds log messages to localhost.2014-12-19.log file with some Java exceptions.</p>
  
  <p>Please see the content of this log file below. It seems to be complaining about java.lang.ClassNotFoundException</p>
  
  <pre><code> Dec 19, 2014 10:49:58 AM org.apache.catalina.core.StandardContext listenerStart
  SEVERE: Error configuring application listener of class org.codehaus.groovy.grails.plugins.log4j.web.util.Log4jConfigListener
  java.lang.ClassNotFoundException: org.codehaus.groovy.grails.plugins.log4j.web.util.Log4jConfigListener
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
      at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:506)
      at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:488)
      at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:115)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4909)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
      at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1081)
      at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1877)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:744)
  
  Dec 19, 2014 10:49:58 AM org.apache.catalina.core.StandardContext listenerStart
  SEVERE: Error configuring application listener of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener
  java.lang.ClassNotFoundException: org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
      at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:506)
      at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:488)
      at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:115)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4909)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
      at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1081)
      at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1877)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:744)
  
  Dec 19, 2014 10:49:58 AM org.apache.catalina.core.StandardContext listenerStart
  SEVERE: Skipped installing application listeners due to previous error(s)
  Dec 19, 2014 10:49:59 AM org.apache.catalina.core.ApplicationContext log
  INFO: ContextListener: contextInitialized()
  Dec 19, 2014 10:49:59 AM org.apache.catalina.core.ApplicationContext log
  INFO: SessionListener: contextInitialized()
  Dec 19, 2014 10:49:59 AM org.apache.catalina.core.ApplicationContext log
  INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@61eed513')
  Dec 19, 2014 10:51:06 AM org.apache.catalina.core.StandardContext listenerStart
  SEVERE: Error configuring application listener of class org.codehaus.groovy.grails.plugins.log4j.web.util.Log4jConfigListener
  java.lang.ClassNotFoundException: org.codehaus.groovy.grails.plugins.log4j.web.util.Log4jConfigListener
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
      at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:506)
      at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:488)
      at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:115)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4909)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1286)
      at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:694)
      at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:217)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:213)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:612)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
      at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2466)
      at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2455)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Thread.java:744)
  
  Dec 19, 2014 10:51:06 AM org.apache.catalina.core.StandardContext listenerStart
  SEVERE: Error configuring application listener of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener
  java.lang.ClassNotFoundException: org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
      at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:506)
      at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:488)
      at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:115)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4909)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1286)
      at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:694)
      at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:217)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:213)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:612)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
      at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2466)
      at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2455)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      at java.lang.Thread.run(Thread.java:744)
  
  Dec 19, 2014 10:51:06 AM org.apache.catalina.core.StandardContext listenerStart
  SEVERE: Skipped installing application listeners due to previous error(s)
  </code></pre>