简体   繁体   中英

What issues can arise from including spring-boot-starter-tomcat when deploying to a Tomcat server?

I converted a Spring MVC web service to Spring Boot (using spring-boot-starter-web). The service is packaged as a .war and has been deployed to a Tomcat 8 server, but I forgot to explicitly add the spring-boot-starter-tomcat dependency and mark it provided as per Spring's traditional deployment instructions .

The service appears to be behaving correctly, ie all endpoints return or post the correct data, and I don't see any errors in the server or app logs.

We have a monthly release cycle, so I'm currently planning to correct this next month. However, I want to understand any potential impact in case I'm missing something and should consider fixing it off-cycle. From my research, it seems most issues from this would occur at deployment/startup time, but the service is deploying and starting up successfully. Could there potentially be 2 instances of the service running now, ie embedded Tomcat and the actual Tomcat server? Any other potential bugs or ticking time bombs?

  • if you had 2 instances of tomcat running it would bbe on different ports so would be visible with some netstat command or with a ps -ef | grep java to display all the running java processes. you'll recognize yours quite easily with the parameters ps will return
  • if you had 2 webapps with the same tomcat, the contextPath would be different, so visible in the logs I guess, or in the manager if available, or in jmx console
  • to ensure there is no risk, ask for a duplication of the server as much as possible and try to deploy the spring's instructions way
  • just a worry about security breach if you have an old tomcat running and it's not the one you want, it might not be configured as you want and may expose a breach (worse case scenario I guess).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM