Java Intro to Java Web Development with Spark Diving into Web Development Meet Spark

scotty mikul
scotty mikul
Java Web Development Techdegree Graduate 11,163 Points

java.net.BindException: Address already in use: bind

I got this example to work but I'm getting a strange bind warning when I run this program. How do I resolve this problem?

WARN org.eclipse.jetty.util.component.AbstractLifeCycle - FAILED ServerConnector@685045ca{HTTP/1.1,[http/1.1]}{0.0.0.0:4567}: java.net.BindException: Address already in use: bind java.net.BindException: Address already in use: bind.

2 Answers

Alexander Nikiforov
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Alexander Nikiforov
Java Web Development Techdegree Graduate 22,150 Points

Port 4567 is in use. Make sure that you killed previous app and that port 4567 is free. There are plenty resources how to check which ports are in use and how to kill application related. If however port 4567 is used by system, try to change it "port(4568)" command. How to change port see documentation:

http://sparkjava.com/documentation.html