Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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

scotty mikul
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
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,175 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