【发布时间】:2016-04-12 09:06:23
【问题描述】:
我有一个带有 Spring Boot 和 Jersey 的 REST API,打包为 jar。当我运行我的应用程序(使用 IntelliJ)时,我可以导航到:
http://localhost:8080/clients
我得到了所有的客户。现在,我对pom.xml 进行了一些更改,以便将其打包为war,因为我需要将其部署到外部Tomcat 中。
当我打包 war(命名为 apirest.war)并将其部署在该 Tomcat 中时,我导航到:
http://api.mycompany.com/apirest/clients
但我得到HTTP 404 Error。发生了什么?
【问题讨论】:
-
您是否还添加了
SpringBootServletInitializer子类,如here 所述? -
你的 tomcat server.xml 上下文配置是什么样的?
-
@AndyWilkinson 我刚刚添加了它,但仍然无法正常工作。
标签: tomcat spring-boot