Two spring boot applications are running on same tomcat, my configuration are as follows:
application.properties
For first application
spring.application.name=app1
spring.jmx.default-domain=app1
For second application
spring.application.name=app2
spring.jmx.default-domain=app2
About two application
app1 : Web application + REST API
app2 : Service (running in infinite loop) with @PostConstruct
First I think it was problem of @PostConstruct so I have tried following links:
Other options for @postconstruct
Implementing interface as component
Then I came to read this question:
Multiple spring-boot under same tomcat
So I made changes to application.properties
still my issue not resolved.
Problem:
When I deploy app1 then app2 it works totally fine (very first time), but restarting tomcat will start both application (log files containing data) normally but it fails to load webpage of app1 it gives 503 service unavailable
Answer appericiated.