title: Cannot deploy servlet sample GWT app to Apache Tomcat 7
body: <p>Original, less detailed question found here: <a href="https://stackoverflow.com/questions/16074224/cannot-figure-out-why-i-cannot-deploy-gwt-application-onto-apache-tomcat-7">Cannot figure out why I cannot deploy GWT application onto Apache Tomcat 7</a>. As I was writing this, I decided to try it again and this time it worked however, the servlet in the sample Application does not seem to work. It says "Remote Procedure Call Failure" when clicking the button. Here's the list of steps i took. </p>
  
  <p>Here are the list of things I tried to do in order to deploy a sample app to Apache Tomcat 7.</p>
  
  <p><strong>Setting Up Environment</strong></p>
  
  <ol>
  <li>Install Ubuntu 12.04 on Virtual Machine</li>
  <li>Updated system</li>
  <li>Install Apache Tomcat 7 from tutorial here <a href="https://www.digitalocean.com/community/articles/how-to-install-apache-tomcat-on-ubuntu-12-04" rel="nofollow noreferrer">https://www.digitalocean.com/community/articles/how-to-install-apache-tomcat-on-ubuntu-12-04</a>.</li>
  <li>Start it and go to localhost:8080 to see that it is working. </li>
  </ol>
  
  <p><strong>Getting Sample Project</strong></p>
  
  <ol>
  <li>Have GWT installed.</li>
  <li>Using Eclipse Wizard, Create a new project called "SampleApp"</li>
  <li>Run it once in development mode to ensure it works. </li>
  <li>Compile the module. it does the whole - compiling 6 permutations etc.</li>
  <li>Compile into .war file as shown here <a href="http://blog.elitecoderz.net/gwt-and-tomcat-create-war-using-eclipse-to-deploy-war-on-tomcat/2009/12/" rel="nofollow noreferrer">http://blog.elitecoderz.net/gwt-and-tomcat-create-war-using-eclipse-to-deploy-war-on-tomcat/2009/12/</a> (file is called SampleApp.war)</li>
  </ol>
  
  <p><strong>Deploying</strong></p>
  
  <ol>
  <li>Copy SampleApp.war into webapps folder in Apache Tomcat</li>
  <li>The .war unzips itself and i can now access my app on localhost:8080/SampleApp/SampleApp.html. </li>
  </ol>
  
  <p>However, now my problem is that the server-side code does not seem to work.</p>
  
  <p><strong>The content of localhost_access_log</strong> </p>
  
  <blockquote>
    <p>127.0.0.1 - - [18/Apr/2013:21:03:43 -0700] "GET /SampleApp/SampleApp.html HTTP/1.1" 304 -
    127.0.0.1 - - [18/Apr/2013:21:03:43 -0700] "GET /SampleApp/SampleApp.css HTTP/1.1" 304 -
    127.0.0.1 - - [18/Apr/2013:21:03:43 -0700] "GET /SampleApp/sampleapp/sampleapp.nocache.js HTTP/1.1" 304 -
    127.0.0.1 - - [18/Apr/2013:21:03:43 -0700] "GET /SampleApp/sampleapp/gwt/clean/clean.css HTTP/1.1" 304 -
    127.0.0.1 - - [18/Apr/2013:21:03:43 -0700] "GET /SampleApp/sampleapp/gwt/clean/images/hborder.png HTTP/1.1" 304 -
    127.0.0.1 - - [18/Apr/2013:21:03:44 -0700] "POST /SampleApp/sampleapp/greet HTTP/1.1" 500 2773
    127.0.0.1 - - [18/Apr/2013:21:03:44 -0700] "GET /SampleApp/sampleapp/gwt/clean/images/circles.png HTTP/1.1" 304 -
    127.0.0.1 - - [18/Apr/2013:21:03:44 -0700] "GET /SampleApp/sampleapp/gwt/clean/images/vborder.png HTTP/1.1" 304 -</p>
  </blockquote>
  
  <p><strong>The content of localhost.2013-04-18</strong></p>
  
  <blockquote>
    <p>Apr 18, 2013 8:02:05 PM org.apache.catalina.core.ApplicationContext
    log INFO: ContextListener: contextInitialized() Apr 18, 2013 8:02:05
    PM org.apache.catalina.core.ApplicationContext log INFO:
    SessionListener: contextInitialized() Apr 18, 2013 8:02:05 PM
    org.apache.catalina.core.ApplicationContext log INFO: ContextListener:
    attributeAdded('org.apache.jasper.compiler.TldLocationsCache',
    'org.apache.jasper.compiler.TldLocationsCache@dc0435') Apr 18, 2013
    8:02:16 PM org.apache.catalina.core.ApplicationContext log INFO:
    ContextListener: contextInitialized() Apr 18, 2013 8:02:16 PM
    org.apache.catalina.core.ApplicationContext log INFO: SessionListener:
    contextInitialized() Apr 18, 2013 8:02:16 PM
    org.apache.catalina.core.ApplicationContext log INFO: ContextListener:
    attributeAdded('org.apache.jasper.compiler.TldLocationsCache',
    'org.apache.jasper.compiler.TldLocationsCache@113e9fd') Apr 18, 2013
    8:02:16 PM org.apache.catalina.core.ApplicationContext log INFO:
    SessionListener: contextDestroyed() Apr 18, 2013 8:02:16 PM
    org.apache.catalina.core.ApplicationContext log INFO: ContextListener:
    contextDestroyed() Apr 18, 2013 8:29:48 PM
    org.apache.catalina.core.ApplicationContext log INFO: SessionListener:
    contextDestroyed() Apr 18, 2013 8:29:48 PM
    org.apache.catalina.core.ApplicationContext log INFO: ContextListener:
    contextDestroyed() Apr 18, 2013 8:30:00 PM
    org.apache.catalina.core.ApplicationContext log INFO: ContextListener:
    contextInitialized() Apr 18, 2013 8:30:00 PM
    org.apache.catalina.core.ApplicationContext log INFO: SessionListener:
    contextInitialized() Apr 18, 2013 8:30:00 PM
    org.apache.catalina.core.ApplicationContext log INFO: ContextListener:
    attributeAdded('org.apache.jasper.compiler.TldLocationsCache',
    'org.apache.jasper.compiler.TldLocationsCache@180cb01') Apr 18, 2013
    9:03:36 PM org.apache.catalina.core.ApplicationContext log INFO:
    SessionListener: contextDestroyed() Apr 18, 2013 9:03:36 PM
    org.apache.catalina.core.ApplicationContext log INFO: ContextListener:
    contextDestroyed() Apr 18, 2013 9:03:41 PM
    org.apache.catalina.core.ApplicationContext log INFO: ContextListener:
    contextInitialized() Apr 18, 2013 9:03:41 PM
    org.apache.catalina.core.ApplicationContext log INFO: SessionListener:
    contextInitialized() Apr 18, 2013 9:03:41 PM
    org.apache.catalina.core.ApplicationContext log INFO: ContextListener:
    attributeAdded('org.apache.jasper.compiler.TldLocationsCache',
    'org.apache.jasper.compiler.TldLocationsCache@18600d6')</p>
  </blockquote>
  
  <p><strong>GreetingService.java</strong></p>
  
  <pre><code>package com.sample.client;
  
  import com.google.gwt.user.client.rpc.RemoteService;
  import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
  
  /**
   * The client side stub for the RPC service.
   */
  @RemoteServiceRelativePath("greet")
  public interface GreetingService extends RemoteService {
      String greetServer(String name) throws IllegalArgumentException;
  }
  </code></pre>
  
  <p><strong>/WEB-INF/web.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
                http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
           version="2.5"
           xmlns="http://java.sun.com/xml/ns/javaee"&gt;
  
    &lt;!-- Servlets --&gt;
    &lt;servlet&gt;
      &lt;servlet-name&gt;greetServlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;com.sample.server.GreetingServiceImpl&lt;/servlet-class&gt;
    &lt;/servlet&gt;
  
    &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;greetServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/sampleapp/greet&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  
    &lt;!-- Default page to serve --&gt;
    &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;SampleApp.html&lt;/welcome-file&gt;
    &lt;/welcome-file-list&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p>I've changed noting after generating the project via eclipse.</p>
  
  <p>As I am still trying to figure this out, it may possible have something to do with Java 1.6 and 1.7 SDK and the way tomcat interacts with them</p>