How to fix SEVERE Failed to initialize component Connector

Introduction

In this tutorial, we will learn how to fix the 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.

Apache Tomcat Error Connector Component 8080

Port Conflict

This error happens when there is a port conflict. Here, in this case, some application is listening on the port 8080. 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/

 

Jenkins on Port 8080

Fix

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″ />

 

Connector Server.xml

 

Save the changes to the file.

Restart Apache Tomcat Server.

 

Tomcat port 9090