title: Spring Cloud app - zuul timeout after deploying on Tomcat
body: <p>I'm trying to set up a couple of services using Spring Cloud and everything seems to work fine up until the moment I deploy the Eureka client services to Tomcat. When I call a service through my gateway app, I get the following error:</p>
  
  <pre><code>o.s.c.n.z.filters.post.SendErrorFilter   : Error during filtering
  com.netflix.zuul.exception.ZuulException: Forwarding error
  ...
  Caused by: com.netflix.hystrix.exception.HystrixRuntimeException: hello timed-out and no fallback available.
  ...
  Caused by: java.util.concurrent.TimeoutException: null
  </code></pre>
  
  <p>It works perfectly from eclipse however. It even works when I run the discovery and gateway services from Tomcat, and run the Eureka client service from eclipse. But as soon as I run the same service on tomcat, I get the error.</p>
  
  <p>I'm using Brixton.M5, Java 8 and Tomcat 8.</p>
  
  <p>Again, the code seems to work, the problem is it doesn't work after being deployed to Tomcat.</p>
  
  <p>I have one Tomcat instance for the Discovery and Gateway services, and a second Tomcat instance for the Eureka client services.</p>
  
  <p>Here's some code and config..</p>
  
  <p><strong>DiscoveryServerApp</strong></p>
  
  <pre><code>@SpringBootApplication
  @EnableEurekaServer
  public class DiscoveryServerApp extends SpringBootServletInitializer
  {
      public static void main(String[] args)
      {
          SpringApplication.run(DiscoveryServerApp.class, args);
      }
  }
  </code></pre>
  
  <p>DiscoveryServer - application.yml</p>
  
  <pre><code># Configure this Discovery Server
  eureka:
    instance:
      hostname: discovery
    client:  # Not a client, don't register with yourself
      registerWithEureka: false
      fetchRegistry: false
      serviceUrl:
        defaultZone: http://localhost:1111/discovery/eureka/
  
  server:
    port: 1111   # HTTP (Tomcat) port
    context-path: /discovery
  </code></pre>
  
  <p>DiscoveryServer - bootstrap.yml</p>
  
  <pre><code>spring:
    application:
      name: discovery
    jmx: 
      default-domain: com.example.cloud.discovery
  </code></pre>
  
  <p><strong>GatewayApplication</strong></p>
  
  <pre><code>@SpringCloudApplication
  @EnableZuulProxy
  public class GatewayApplication extends SpringBootServletInitializer
  {
      public static void main(String[] args)
      {
          SpringApplication.run(GatewayApplication.class, args);
      }
  }
  </code></pre>
  
  <p>GatewayApplication - application.yml</p>
  
  <pre><code># Discovery Server Access
  eureka:
    client:
      serviceUrl:
        defaultZone: http://localhost:1111/discovery/eureka/
    instance:
      instanceId: ${spring.application.name}:${spring.application.instance_id:${random.value}}
  
  # HTTP Server
  server:
    port: 4444   # HTTP (Tomcat) port
    context-path: /api
  </code></pre>
  
  <p>GatewayApplication - bootstrap.yml</p>
  
  <pre><code># Spring properties
  spring:
    application:
      name: gateway-service  # Identify this application
    jmx: 
      default-domain: com.example.cloud.gateway
  
  encrypt:
    failOnError: false
  </code></pre>
  
  <p><strong>DummyApplication</strong></p>
  
  <pre><code>@SpringCloudApplication
  @RestController
  public class DummyApplication extends SpringBootServletInitializer
  {
      public static void main(String[] args)
      {
          SpringApplication.run(DummyApplication.class, args);
      }
  
      @RequestMapping( path = "/hello-resource", method = RequestMethod.GET )
      public String hello()
      {
          return "hello";
      }
  }
  </code></pre>
  
  <p>DummyApplication - application.yml</p>
  
  <pre><code># Discovery Server Access
  eureka:
    client:
      serviceUrl:
        defaultZone: http://localhost:1111/discovery/eureka/
    instance:
      instanceId: ${spring.application.name}:${spring.application.instance_id:${random.value}} # Unique id for multiple instances
  
  # HTTP Server
  server:
    port: 3333   # HTTP (Tomcat) port
    context-path: /hello-context
  </code></pre>
  
  <p>DummyApplication - bootstrap.yml</p>
  
  <pre><code># Spring properties
  spring:
    application:
       name: hello-service  # Service registers under this name
    jmx: 
      default-domain: com.example.cloud.hello
  
  encrypt:
    failOnError: false
  </code></pre>