Fix SEVERE Failed to initialize Component Connector [ Updated 2024 ]
Fix SEVERE Failed to initialize Component Connector.
In this tutorial, we will learn how to fix the SEVERE Failed to Initialize Component Connector HTTP/1.1-8080 error during the Apache Tomcat server. This error indicates that the server failed to start on the port 8080.
Error
SEVERE [main] org.apache.catalina.util.LifecycleBase.handleSubClassException Failed to initialize component [Connector[HTTP/1.1-8080]]
org.apache.catalina.LifecycleException: Protocol handler initialization failed.
Port Conflict
This error happens when there is a port conflict. In this case, some applications are listening on port 8080. The Jenkins CI server runs and listens on port 8080 on my machine.
BindException
Caused by: java.net.BindException: Address already in use: bind at java.base/sun.nio.ch.Net.bind0(Native Method) at java.base/sun.nio.ch.Net.bind(Net.java:455) at java.base/sun.nio.ch.Net.bind(Net.java:447) at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:219) at java.base/sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:80) at org.apache.tomcat.util.net.NioEndpoint.initServerSocket(NioEndpoint.java:228) at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:211) at org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup(AbstractEndpoint.java:1141) at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1154) at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:581) at org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:74) at org.apache.catalina.connector.Connector.initInternal(Connector.java:1039)
https://www.testingdocs.com/questions/how-to-find-listening-ports-on-windows/
Fix
First, we need to decide which application to move off from the conflict port number. Since Tomcat is a useful application, we want to move the secondary application from the standard port number, i.e., 8080. It depends on what secondary application is causing the port conflict. In this case, it’s the Jenkins server. This may vary on your computer.
#1 Option
Change the port of the Jenkins server that runs on port 8080. This will resolve the port conflict on port 8080. Instructions on how to change the port for the Jenkins application.
#2 Option
This option is when we decide to move the Tomcat server from listening on port 8080.
We can fix the error by changing the port of the Apache Tomcat server.
The connector port is specified in the server.xml file under
<tomcat dir>\conf directory.
Change the connector port to, let’s say, 9090 port number.
<Connector port="9090" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="9443" />
Save the changes to the file.
Restart Apache Tomcat Server.