我在Tomcat Web应用程序管理器AWS EC2上部署了我的应用程序。当我使用Postman测试POST方法时,出现此错误。
<head>
<title>HTTP Status 404 – Not Found</title>
<style type="text/css">
</head>
<body>
<h1>HTTP Status 404 – Not Found</h1>
<hr class="line" />
<p><b>Type</b> Status Report</p>
<p><b>Message</b> /mobile-app-ws/users</p>
<p><b>Description</b> The origin server did not find a current representation for the target resource or is not
willing to disclose that one exists.</p>
<hr class="line" />
<h3>Apache Tomcat/8.5.51</h3>
</body>
</html>
[ec2-user@ip-172-31-5-187 ~]$ sudo service tomcat8 status
[ec2-user@ip-172-31-5-187 ~]$ .. [ OK ]
[ec2-user@ip-172-31-5-187 ~]$ sudo service mysqld status
mysqld (pid 3852) is running...
[ec2-user@ip-172-31-5-187 ~]$
-- Instance State Status Checks
-- running. 2/2 checks passed
--[ec2-user@ip-172-31-5-187 ~]$ java -version
--openjdk version "1.8.0_252"
--OpenJDK Runtime Environment (build 1.8.0_252-b09)
--OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)
--[ec2-user@ip-172-31-5-187 ~]$
我的应用程序扩展了SpringBootServletInitializer,并覆盖了其SpringApplicationBuilder configure(SpringApplicationBuilder application)
Tomcat Web应用程序管理器上的应用程序名称为/mobile-app-ws
。
我的实例的公共DNS为ec2-54-215-197-6.us-west-1.compute.amazonaws.com
POST的URL,http://ec2-54-215-197-6.us-west-1.compute.amazonaws.com:8080/mobile-app-ws/users
server.servlet.context-path=/mobile-app-ws
的上下文路径
-有人有什么想法吗?谢谢。