title: AWS ELB: Failed to load resource: the server responded with a status of 503 (Service Unavailable: Back-end server is at capacity)
body: <p>my cloudformation stack is deployed successfully. I'm trying to deploy a clojure ring app on EC2. </p>
  
  <p>When I access my elastic load balance endpoint at <code>my-app.us-west-1.elb.amazonaws.com</code> I get<code>Failed to load resource: the server responded with a status of 503 (Service Unavailable: Back-end server is at capacity)</code></p>
  
  <p>I confirmed the tomcat was running by sshing into the ec2 and running <code>ps -afx</code></p>
  
  <p>So what could possibly be the problem here?</p>
  
  <p>update: okay so doing a curl request to localhost:8080 returns HTTP 500</p>
  
  <pre><code>SEVERE: Servlet.service() for servlet [clj-west.system/servlet-handler servlet] in context with path [] threw exception
  java.lang.NullPointerException: Handler returned nil
          at ring.util.servlet$make_service_method$fn__52.invoke(servlet.clj:127)
          at clj_west.servlet$_service.invoke(servlet.clj:1)
          at clj_west.servlet.service(Unknown Source)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
          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.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:505)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
          at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
          at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
          at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
          at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
          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:745)
  </code></pre>