1

I changed the server.port=8190 in application.properties, but the server is accessible from both ports 8190 and 8080.
How to completely override 8080 port?

6
  • Where did you define the port ? Commented Dec 6, 2016 at 11:46
  • @ASdi If you read the question, it already says that the port is defined in the application.properties file. Commented Dec 6, 2016 at 11:47
  • Have you checked that there isn't any other instances of tomcat running? Try stopping spring boot and try to load the app on 8190 does it still work? Commented Dec 6, 2016 at 11:48
  • I mean you may overwrite it somewhere else like program arguments Commented Dec 6, 2016 at 11:48
  • @px06 I checked, just one instance of tomcat is running. I stopped everything and started the app with java -jar app.jar Commented Dec 6, 2016 at 11:53

2 Answers 2

1

Its likely that you have an additonal 'zombie' tomcat process still running. Are you sure only one tomcat instance is getting started up by spring boot?

Alternatively try:

java -Dserver.port=8190 -jar app.jar

Sign up to request clarification or add additional context in comments.

Comments

0

The problem was that I had dependencies for tomcat in build.gradle:

compile("org.apache.tomcat.embed:tomcat-embed-core:8.5.8")
compile("org.apache.tomcat.embed:tomcat-embed-jasper:8.5.8")
compile("org.apache.tomcat.embed:tomcat-embed-logging-juli:8.5.2")

I removed the above lines and now the server is running only on port 8190.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.