spring-guides / gs-rest-service

Building a RESTful Web Service :: Learn how to create a RESTful web service with Spring.

Home Page:https://spring.io/guides/gs/rest-service/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can you change port?

itdsntwork opened this issue · comments

The Tomcat connector configured to listen on port 8080 failed to start. The port may already be in use or the connector may be misconfigured.

I could not run the app even once so the port is busy for some reason. You cannot change the port from the configuration. Does anybody know how to?

Here's what helped with me. I had some oracle service uselessly occupying 8080.

Check what's listening on that port and then kill it. You can find out with resource monitor (run resmon). Under Listening Ports you can see what's listening on 8080.
Then go to task manager and kill the process.

Here's another think u can try, Go to the servers, and change the listening port number from 8080 to some another port number, and run on that port number. This may be help to out.

By default Spring Boot uses the 8080 port. you may set the server.port property in your application properties. for example server.port=8383. now the problem is sometimes a Spring Boot application still executing that you don't have correctly terminated.

server.port

@harshp2826 there is no application.properties file in this repo. @zly1991 where did you configured that server.port exactly?

You can look it up in the Spring Boot user guide, or this getting started guide: https://spring.io/guides/gs/spring-boot/.