so your server socket may have TIME_WAIT state,
in this case,
the tomcat-embedded-server in spring boot can't bind this port because
SO_REUSEADDR is not set to true
there is a similar issue for that-
Spring Boot application in eclipse, the Tomcat connector configured to listen on port XXXX failed to start
- Protocol handler start failed
Spring Boot Issue while Running the Spring Boot APP
Solutions:- there are multiple solutions,
so getting to know what exactly your issue is not so easy,
here is more than one solution,
Hit and try which one works for you.
1-
so my solution is to use Jetty in spring boot, you can change your pom.xml
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jetty</artifactId>
|
if the above one not working, try from below solution
2-
goto task manager -> processes and end Java(TM) Platform SE binary
processes (this will stop tomcat) and run your spring boot application again.
3-
On the console, looking at the topmost right side of the dialog you
should see a red button kinda like a buzzer. To stop the spring boot
application properly you just ran, go ahead and hit this particular
"red" button and your problem is solved. Hope this helps!
here is some more solution-
4-
Find the process ID (PID) for the port (e.g.: 8080)
On Windows:
netstat -ao | find "8080"
Other Platforms other than windows :
lsof -i:8080
Kill the process ID you found (e.g.: 20712)
On Windows:
Taskkill /PID 20712 /F
Other Platforms other than windows :
kill -9 20712 or kill 20712
No comments:
Post a Comment