About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.
When Tomcat logs java.net.BindException: Address already in use, something else already listens on a port Tomcat needs: the port of an HTTP connector (8080 in the default setup) or its shutdown port. Only one program can listen on one port and address, so the second one fails. No vendor page prints this exact line; Java prints the class name and the operating system's text for the failed bind (our own reading). Find the holder with ss or netstat, then either stop the holder or give Tomcat a different port. Do not change Tomcat's ports until you know what holds the current one.
What the error means
Oracle's Java SE 21 documentation describes BindException this way: "Signals that an error occurred while attempting to bind a socket to a local address and port. Typically, the port is in use, or the requested local address could not be assigned." Our own reading: the text after the class name is the operating system's error text. The Linux errno manual page lists EADDRINUSE as "Address already in use" and EADDRNOTAVAIL as "Address not available".
Tomcat's HTTP connector page says the port attribute is where the connector "will create a server socket and await incoming connections", and that "Your operating system will allow only one server application to listen to a particular port number on a particular IP address." It also says bindOnInit defaults to true, so the socket is bound when the connector is initialised, which is before the connector starts.
In the Tomcat 10.1.62 source, a connector that fails to bind raises Protocol handler initialization failed, and the message template Failed to initialize component [{0}] exists in the source. Our own reading: the lifecycle base class then reports the failure as Failed to initialize component [Connector[HTTP/1.1-8080]], where in the default setup the inner bracket holds the protocol and port. The Tomcat 8.5.100 source words it Failed to initialize connector [{0}], and the cause is the same.
The shutdown port can fail on its own. The Server element's port is where Tomcat waits for the shutdown command, on localhost unless address says otherwise. If it cannot be bound, the 10.1.62 source logs Failed to create server shutdown socket on address [localhost] and port [8005] (base port [8005] and offset [0]) for whichever values apply. A comment in Catalina.java says that when initialisation fails and the server is waiting, it is better to throw the error than to start the server and stop it again at once. Our own reading: a connector bind failure at start-up ends the Tomcat process started by the standard scripts.
Likely causes
| Cause | What you see | How to confirm |
|---|---|---|
| A second Tomcat instance with the same ports | The error names 8080 or the shutdown port; another java process listens there |
ss or netstat shows a java process holding the port |
| The same instance started twice, or an old process never stopped | The holder was started earlier from the same directory | The process start time and Tomcat's PID file (if CATALINA_PID is set) match it |
| A different program on the port | The holder is not java |
The process name from ss -p or netstat -b |
| Shutdown port clash between instances | The message names the shutdown socket, not a connector | Two instances share the port of the Server element |
A connector address that is not on this host |
A different bind error: errno(3) describes EADDRNOTAVAIL as "Address not available"; the text Java prints depends on the operating system | Compare the connector's address with the server's own addresses |
Prove the cause before changing anything
All of these read only.
1. Read the first error in the log. On Unix the console output usually goes to catalina.out, per Tomcat's logging page; other logs are in ${catalina.base}/logs. Note the port in the brackets, for example HTTP/1.1-8080.
2. Find the process holding the port. On Linux, ss with -l (listening), -t (TCP), -n (numeric) and -p (show processes using sockets) takes a filter, as its page shows with sport = :http:
ss -ltnp 'sport = :8080'
One listening row with a process name is the holder. No row means nothing holds that port now, and the failure was a clash that has since ended or a different port.
On Windows, netstat -ano lists listening ports with the process ID; Microsoft's page says the PID can be matched on the Processes tab of Task Manager. -b names the executable but "will fail unless you have sufficient permissions".
netstat -ano
3. Say what the holder is. A java process may be a second Tomcat. If CATALINA_PID is set in setenv, RUNNING.txt says it names the file that holds the process ID of the Tomcat java process, so the file shows which instance a PID belongs to. Compare the holder's start time with the failed start.
4. For a shutdown-port error, repeat step 2 with the shutdown port, for example 'sport = :8005'.
Fix
Choose by what the holder is.
The holder is another Tomcat that should not be running
Tomcat's RUNNING.txt names shutdown.sh (and shutdown.bat) as the standard shutdown command. CATALINA_BASE, per the same file, is the root of an instance, so a script acts on the instance named by its environment.
First save the current state:
ss -ltnp > listeners-before.txt
Disruptive step: the next command stops the Tomcat instance that holds the port. Every request in flight on it is dropped, sessions held in its memory are lost, and any site served only by that instance goes offline until it is started again.
Stop the other instance with its own script:
/opt/tomcat-old/bin/shutdown.sh
Our own advice: before you start the Tomcat that failed, which is the next step, wait until the old process has gone, which ss -ltnp shows by the port no longer being listed, because the script only sends the stop command and a start that overlaps the old process can fail on the same port.
Only if you need to back out, the old instance is started again with its own start script. Start it only after the new instance has been stopped, because the old one would otherwise clash with it for the same port again.
Disruptive step: the next command starts the old Tomcat instance again. It binds its ports at once, so it fails with the same error if anything else holds them, and sites served by it come back online.
/opt/tomcat-old/bin/startup.sh
Then check that it listens again and compare the result with listeners-before.txt:
ss -ltnp
The holder must keep the port
The remedy is another port for Tomcat. For a second instance on one host, the Server element's portOffset attribute is applied to its port and to the ports of nested connectors; it must be a non-negative integer and defaults to 0. Each port can instead be changed by hand. Whatever points at the old port then needs the new one, which the warning below covers. The steps follow.
First save the current state:
cp -p /opt/tomcat/conf/server.xml /opt/tomcat/conf/server.xml.2026-12-03
Risk: the next edit changes the ports Tomcat listens on, and Tomcat must be restarted to use them. Browsers, proxies, load balancers, firewall rules and monitoring that use the old port stop reaching the site until they are updated. Requests in flight are dropped and sessions held in memory are lost at the restart. A wrong edit leaves Tomcat unable to start.
Edit server.xml: change the port of the connector, or add portOffset="1" to the Server element. Then stop Tomcat with its script:
/opt/tomcat/bin/shutdown.sh
Our own advice: wait until the old process has gone, which ss -ltnp shows by its ports no longer being listed, because the script only sends the stop command. Then start Tomcat:
/opt/tomcat/bin/startup.sh
Only if you need to back out, restore the saved file and then stop and start Tomcat again.
Disruptive step: the next command puts back the saved server.xml, which discards the port change. Tomcat then has to be stopped and started again, which drops every request in flight and every session held in memory. Whatever was changed to use the new port must be changed back to the old one.
cp -p /opt/tomcat/conf/server.xml.2026-12-03 /opt/tomcat/conf/server.xml
After it, stop Tomcat with /opt/tomcat/bin/shutdown.sh, wait until the old process has gone in the same way, and start it with /opt/tomcat/bin/startup.sh. Check the listener afterwards with ss -ltnp.
The holder is a different program
Whether to move that program or Tomcat is a decision for whoever owns both. The port change above covers the Tomcat side.
Example (illustrative): On web01, Tomcat started from /opt/tomcat at 09:12 and ended at once with Failed to initialize component [Connector[HTTP/1.1-8080]] and java.net.BindException: Address already in use. ss -ltnp 'sport = :8080' shows a java process, PID 2311, listening on port 8080. Its start time is 08:40, from a deployment script that used /opt/tomcat-old. The administrator saves the ss output, stops the old instance with /opt/tomcat-old/bin/shutdown.sh, starts /opt/tomcat and sees one listener on 8080 for the new PID.
Confirm the fix
- The log shows no
BindExceptionafter the start. ss -ltnp 'sport = :8080', ornetstat -anoon Windows, shows exactly one listener, and its process is the Tomcat you intended.- No
Failed to create server shutdown socketline appears in the log.
What to watch afterwards
- Two Tomcat instances on one host need different ports for every connector and for the shutdown port, or a
portOffseteach. - Start scripts that run on every deployment can launch a second copy.
CATALINA_PID, perRUNNING.txt, gives "better protection against duplicate start attempts". - A service and a hand-started instance of the same Tomcat on one server.
- Setting the shutdown port to
-1is not a cure for a clash. Tomcat's Server page says it suits Tomcat started with Apache Commons Daemon, and "will prevent shutdown.bat|.sh and catalina.bat|.sh from stopping it gracefully" when the standard scripts are used.
Read next
Related articles you may want next.
- Troubleshootingbind() to 0.0.0.0:80 failed (98: Address already in use): nginx or Apache will not startnginx or Apache will not start: bind() to 0.0.0.0:80 failed (98: Address already in use). Find the process holding the port with ss and fix the conflict.Read article
- TroubleshootingJava "Keystore was tampered with, or password was incorrect": prove which one, then correct the password or replace the filejava.io.IOException: Keystore was tampered with, or password was incorrect. Test the store password with keytool, then fix Tomcat's server.xml or the file.Read article
- Troubleshootingjava.lang.OutOfMemoryError: Java heap space - tell a small heap from a leak, then capture a heap dumpjava.lang.OutOfMemoryError: Java heap space is a small heap or a leak. Check -Xmx with jcmd, read the GC log and write a heap dump on the next failure.Read article
Risks and limits
- These commands have not been run or lab-tested.
- Microsoft's page says
netstat -b"will fail unless you have sufficient permissions". Our own reading:ss -pmay likewise show no process name without enough permission. - Wording differs between Tomcat releases (the example above is 10.1.62; 8.5.100 words the start error differently), and the Windows text after
BindExceptionmay differ from the Linux text. - Port numbers other than those in the example come from your own
server.xml; the standard file may have been changed.
Sources
- Apache Tomcat 10 Configuration Reference — Apache Software Foundation, The HTTP Connector, version 10.1.62, 10 November 2026, accessed 3 December 2026
- Apache Tomcat 10 Configuration Reference — Apache Software Foundation, The Server Component, version 10.1.62, 10 November 2026, accessed 3 December 2026
- Apache Tomcat 10 — Apache Software Foundation, Logging in Tomcat, version 10.1.62, 10 November 2026, accessed 3 December 2026
- RUNNING.txt — Apache Tomcat source, tag 10.1.62, no date shown, accessed 3 December 2026
- Connector.java — Apache Tomcat source, tag 10.1.62, no date shown, accessed 3 December 2026
- StandardServer.java — Apache Tomcat source, tag 10.1.62, no date shown, accessed 3 December 2026
- Catalina.java — Apache Tomcat source, tag 10.1.62, no date shown, accessed 3 December 2026
- LocalStrings.properties (org.apache.catalina.util) — Apache Tomcat source, tag 10.1.62, no date shown, accessed 3 December 2026
- LocalStrings.properties (org.apache.catalina.core, 10.1.62) — Apache Tomcat source, tag 10.1.62, no date shown, accessed 3 December 2026
- LocalStrings.properties (org.apache.catalina.connector) — Apache Tomcat source, tag 10.1.62, no date shown, accessed 3 December 2026
- LocalStrings.properties (org.apache.catalina.core, 8.5.100) — Apache Tomcat source, tag 8.5.100, no date shown, accessed 3 December 2026
- Class BindException — Oracle, Java SE 21 API, no date shown, accessed 3 December 2026
- ss(8) — Linux manual page — man7.org, no document date shown, accessed 3 December 2026
- errno(3) — Linux manual page — man7.org, Linux man-pages 6.19, 28 May 2026, accessed 3 December 2026
- netstat — Microsoft Learn, 8 September 2026, accessed 3 December 2026
This article was originally published on .