HTTP状态404 –找不到。 AWS EC2

时间:2020-06-20 05:25:19

标签: amazon-web-services spring-boot amazon-ec2 tomcat8

我在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> &#47;mobile-app-ws&#47;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>
  1. 我确定tomcat8和MySQL正在运行。
    [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 ~]$ 
  1. 我在EC2上的实例运行良好。
--    Instance State      Status Checks
--    running.            2/2 checks passed

  1. 我的应用程序和EC2上的Java版本均为1.8。
--[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 ~]$ 

  1. 我的应用程序扩展了SpringBootServletInitializer,并覆盖了其SpringApplicationBuilder configure(SpringApplicationBuilder application)

  2. Tomcat Web应用程序管理器上的应用程序名称为/mobile-app-ws

  3. 我的实例的公共DNS为ec2-54-215-197-6.us-west-1.compute.amazonaws.com

  4. POST的URL,http://ec2-54-215-197-6.us-west-1.compute.amazonaws.com:8080/mobile-app-ws/users

  5. 我的应用程序server.servlet.context-path=/mobile-app-ws
  6. 上下文路径

-有人有什么想法吗?谢谢。

0 个答案:

没有答案