简体   繁体   English

部署到Tomcat服务器时,包括spring-boot-starter-tomcat会引起什么问题?

[英]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). 我将Spring MVC Web服务转换为Spring Boot(使用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 . 该服务打包为.war并已部署到Tomcat 8服务器,但是我忘了明确添加spring-boot-starter-tomcat依赖项,并将其标记为按照Spring的传统部署说明提供

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? 现在可能正在运行该服务的2个实例,即嵌入式Tomcat和实际的Tomcat服务器吗? 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 | 如果您有2个运行的tomcat实例,它将在不同的端口上运行,因此可以通过一些netstat命令或ps -ef | grep java to display all the running java processes. grep java显示所有正在运行的java进程。 you'll recognize yours quite easily with the parameters ps will return 使用ps将返回的参数,您将很容易识别您的
  • 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 如果您有2个具有相同tomcat的Web应用程序,则contextPath将有所不同,因此在我猜想的日志中,管理器中(如果可用)或jmx控制台中都可见
  • 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 为了确保没有风险,请尽可能多地复制服务器,并尝试部署spring的说明方法
  • 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). 如果您运行的是旧的tomcat,而不是您想要的,就只需要担心安全漏洞,它可能没有按您的要求进行配置,并且可能会暴露安全漏洞(我猜是最糟糕的情况)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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