Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

No warning starting Jetty on port already in use (on Windows)

This is a peculiarity of the implementation of the ServerSocketChannel on the Windows platform and effects the SelectChannelConnector. See also the Sun bug 4546610.

The work around is to use the setReuseAddress(false) on the SelectChannelConnector. By default, this value is set to true, and enables the socket option SO_REUSEADDRESS. This means that a socket may be opened, even if there is previous close (ie the port is in TIME_WAIT state) still pending on that socket. Setting it to false does not permit the socket to be re-opened in that state, but it also allows an Exception to be thrown if the socket is in use, eg by another Jetty instance.

Contact the core Jetty developers at
private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery