0
votes

I have deployed a spring boot application on an external tomcat server. The port configured in the server.xml is 9090 while the server.port in application.properties file is 8080 . And the application is deployed on 9090. Is there any way I can start/deploy my application on the port configured in application.properties file (which is 8080)?

1
The server.* properties only apply when using the embedded container not when deploying to an external server. The only way is to configure tomcat with an additional connector and bind your applicaiton to that, but you all have to configure that in the external tomcat.M. Deinum
@M.Deinum thanks for the response. Could you please let me know how do I do that configuration in external tomcat?Prachi Jain

1 Answers

0
votes

What I think is, The value of server.port property of the application.properties refers to the embedded server's port not the external servers.

If you always need to deploy your project on port which you mentioned on the application.properties then you need to use the embedded server.

By adding an embedded server's dependency on pom.xml you can achieve it.

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>

Then run your Spring boot mail class or run you jar via command line.