【问题标题】:Apache Tomcat error - HTTP Status 404/ whitelabel errorApache Tomcat 错误 - HTTP 状态 404/whitelabel 错误
【发布时间】:2021-06-19 09:33:06
【问题描述】:

我尝试在 apache tomcat 中部署一个 war 文件,并尝试了来自浏览器的不同服务。但我收到以下错误。

<html lang="en">
<head>
<title>HTTP Status 404 – Not Found</title>
</head>
<body>
<h1>HTTP Status 404 – Not Found</h1>
<hr class="line" />
<p><b>Type</b> Status Report</p>
<p><b>Message</b> The requested resource [&#47;executor.war&#47;executor&#47;create] is not 
available</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/9.0.44</h3>
</body>
</html>

我尝试了 Get 和 Post 映射,但都不起作用。 我还尝试从重定向端口 8443 部署和运行 war 文件,但它会引发以下错误。

Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
There was an unexpected error (type=Not Found, status=404).
No message available

我还检查了网址,这是绝对正确的。例如http://localhost:8443/project/ping 这里的项目是我的战争文件名。 我的项目连接了MongoDB,对我的项目有影响吗?

请帮我解决这个错误。谢谢。

【问题讨论】:

  • war 文件名中的 .war 部分不应成为项目 URL 的一部分。
  • 在 Tomcat 日志文件中查找应用程序的启动错误并将其发布在此处;使用 Tomcat Manager 查找有关您的 web 应用程序的信息。

标签: java eclipse tomcat postman


【解决方案1】:

您能否检查部署的上下文名称并在 URL 中使用它。

Tomcat 服务器记录说的 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive[project-name-1.0.0-SNAPSHOT.war]。

查询 URL 将是例如http://localhost:8443/project-name-1.0.0-SNAPSHOT/ping

【讨论】:

    猜你喜欢
    • 2014-09-11
    • 2017-03-28
    • 1970-01-01
    • 1970-01-01
    • 2010-11-12
    • 1970-01-01
    • 1970-01-01
    • 2018-11-18
    • 2012-04-22
    相关资源
    最近更新 更多