Cannot start Tomcat on Windows Server Due to Address Already in Use: JVM_Bind

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

You are not able to bind Tomcat to port in Microsoft Windows Server due to a port conflict with another application.  In this example, the port conflict will be with port 80, which is the most common conflicting port.

The following appears in catalina.out:

Mar 14, 2013 2:03:36 PM org.apache.coyote.http11.Http11Protocol init
SEVERE: Error initializing endpoint
java.net.BindException: Address already in use: JVM_Bind <null>:80
        at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:549)
        at org.apache.coyote.http11.Http11Protocol.init(Http11Protocol.java:176)
        at org.apache.catalina.connector.Connector.initialize(Connector.java:1022)
        at org.apache.catalina.core.StandardService.initialize(StandardService.java:703)
        at org.apache.catalina.core.StandardServer.initialize(StandardServer.java:838)
        at org.apache.catalina.startup.Catalina.load(Catalina.java:538)
        at org.apache.catalina.startup.Catalina.load(Catalina.java:562)
        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.load(Bootstrap.java:261)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.net.BindException: Address already in use: JVM_Bind
        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.<init>(ServerSocket.java:194)
        at java.net.ServerSocket.<init>(ServerSocket.java:150)
        at org.apache.tomcat.util.net.DefaultServerSocketFactory.createSocket(DefaultServerSocketFactory.java:50)
        at org.apache.tomcat.util.net.JIoEndpoint.init(JIoEndpoint.java:538)
        ... 12 more

Cause

Another application has bound to one of the ports specified in your <confluence-install>/conf/server.xml Connectors, preventing Tomcat from binding the port.

In the specific instance of port 80 or 443, these are privileged ports that can only be bound by a system account.  Normally, standard HTTP/S ports are taken by IIS, but in the case of port 80, it can also be bound by an on-demand HTTP.sys driver that is normally invoked by the Windows Remote Management (WRM) service, or by Print Spooler, though the latter is less likely.

Resolution

  1. First, identify which Process is binding the desired port by running this from the Command Prompt: (all examples will assume port 80 for simplicity)

    netstat -nao | findstr ":80"

    You should get an output similar to this:

  2. Next, use the ProcessID (value in the last column) to find out which process is holding the port:

    tasklist | findstr "4"

    Output:

  3. In this case, the System process is binding port 80. As mentioned above, this is typically either the IIS service, or the HTTP.sys driver binding the port for WRM or Print Spooler.
    1. Check to see if IIS is binding the port from the IIS manager by expanding the Web Site name, then the Sites location and select a site. The Browse Web Site section in the right nav menu should include the port binding:

      IIS is currently binding port 80 for the Sharepoint site running on this server. To change the bind port for the site, click Bindings... under Edit Site. This change will require a restart of the site.
    2. The WRM service by default is set to Automatic (Delayed), and Print Spooler shouldn't need to bind a port unless Windows is hosting a network printer, so installing Confluence as a service and restarting the host should clear up any port conflicts as Tomcat will bind the port before the other two services. If the port is still bound by the System process, you can try binding the driver to a specific IP or disabling the http.sys driver; however, these two options are untested by Atlassian and are provided for informational purposes.
    3. If the port is bound by a non-System process, shut down the application binding the port and attempt to restart the Tomcat process.
Last modified on Mar 30, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.