In this article, we will see how to fix spring boot BindException: Address already in use error.
If you are getting the following error while starting your spring-boot application, this means the 8080 port is being used by another application. You can stop the other application, or follow the approach mentioned below.
java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:433)
at sun.nio.ch.Net.bind(Net.java:425)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:210)
at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:978)
at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:628)
at org.apache.catalina.connector.Connector.startInternal(Connector.java:993)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardService.addConnector(StandardService.java:225)
To fix this, you can add a new property “server.port” in Application.properties file with any port other than 8080.
e.g.
server.port=8082
© 2017 – 2018, https:. All rights reserved. On republishing this post, you must provide link to original post