title: EC2 AWS Instance: Check if tomcat is running
body: <p>I'm using amazon EC2 instances to run tomcat servers.</p>
  
  <p>I do this with java. I know how to start up an instance dynamically but the problem is that I have to wait to make webservice calls (the instances run a tomcat server which run an project with http services) till AFTER tomcat is running.</p>
  
  <p>Is there a way to request the Tomcat running state at the ec2 instance?</p>
  
  <p>So my java project created a new EC2 instances with a certain AMI.
  I wait till that instance is booted and get the public DNS.
  Then I want to do some webservice calls to that EC2 instance. The problem is that I get a connection refused error if I request too fast and tomcat isn't running yet.</p>