title: Tomcat fails to start in Eclipse - java.net.BindException: Address already in use
body: <p>I'm new to Tomcat and Eclipse, but have been searching for a solution for days.  I've installed Tomcat v7.0 and can start/stop it from the terminal, but I can't get it to work from Eclipse.  I'm following the tutorial at <a href="http://www.vogella.de/articles/EclipseWTP/article.html#jspservlets" rel="nofollow">http://www.vogella.de/articles/EclipseWTP/article.html#jspservlets</a>, but when I attempt to run my servlet I get the alert: "Server Tomcat v7.0 Server at localhost failed to start" with the console output as:</p>
  
  <pre><code>Feb 18, 2012 7:05:54 PM org.apache.catalina.core.AprLifecycleListener init
  INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: .:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java
  Feb 18, 2012 7:05:54 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
  WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:de.vogella.wtp.filecounter' did not find a matching property.
  Feb 18, 2012 7:05:54 PM org.apache.coyote.AbstractProtocol init
  INFO: Initializing ProtocolHandler ["http-bio-8080"]
  Feb 18, 2012 7:05:54 PM org.apache.coyote.AbstractProtocol init
  INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
  Feb 18, 2012 7:05:54 PM org.apache.catalina.startup.Catalina load
  INFO: Initialization processed in 1046 ms
  Feb 18, 2012 7:05:54 PM org.apache.catalina.core.StandardService startInternal
  INFO: Starting service Catalina
  Feb 18, 2012 7:05:54 PM org.apache.catalina.core.StandardEngine startInternal
  INFO: Starting Servlet Engine: Apache Tomcat/7.0.25
  Feb 18, 2012 7:05:55 PM org.apache.coyote.AbstractProtocol start
  INFO: Starting ProtocolHandler ["http-bio-8080"]
  Feb 18, 2012 7:05:55 PM org.apache.coyote.AbstractProtocol start
  INFO: Starting ProtocolHandler ["ajp-bio-8009"]
  Feb 18, 2012 7:05:55 PM org.apache.catalina.startup.Catalina start
  INFO: Server startup in 654 ms
  Feb 18, 2012 7:05:55 PM org.apache.catalina.core.StandardServer await
  SEVERE: StandardServer.await: create[localhost:8005]: 
  java.net.BindException: Address already in use
  at java.net.PlainSocketImpl.socketBind(Native Method)
  at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:383)
  at java.net.ServerSocket.bind(ServerSocket.java:328)
  at java.net.ServerSocket.&lt;init&gt;(ServerSocket.java:194)
  at org.apache.catalina.core.StandardServer.await(StandardServer.java:422)
  at org.apache.catalina.startup.Catalina.await(Catalina.java:728)
  at org.apache.catalina.startup.Catalina.start(Catalina.java:674)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at java.lang.reflect.Method.invoke(Method.java:597)
  at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)
  at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:450)
  Feb 18, 2012 7:05:55 PM org.apache.coyote.AbstractProtocol pause
  INFO: Pausing ProtocolHandler ["http-bio-8080"]
  Feb 18, 2012 7:05:55 PM org.apache.coyote.AbstractProtocol pause
  INFO: Pausing ProtocolHandler ["ajp-bio-8009"]
  Feb 18, 2012 7:05:55 PM org.apache.catalina.core.StandardService stopInternal
  INFO: Stopping service Catalina
  Feb 18, 2012 7:05:55 PM org.apache.coyote.AbstractProtocol stop
  INFO: Stopping ProtocolHandler ["http-bio-8080"]
  Feb 18, 2012 7:05:55 PM org.apache.coyote.AbstractProtocol stop
  INFO: Stopping ProtocolHandler ["ajp-bio-8009"]
  Feb 18, 2012 7:05:55 PM org.apache.coyote.AbstractProtocol destroy
  INFO: Destroying ProtocolHandler ["http-bio-8080"]
  Feb 18, 2012 7:05:55 PM org.apache.coyote.AbstractProtocol destroy
  INFO: Destroying ProtocolHandler ["ajp-bio-8009"]
  </code></pre>
  
  <p>netstat doesn't show ports 8080, 8005 or 8009 in use before I attempt to run Tomcat, so that doesn't seem to be the problem.  Any idea what's going wrong?</p>