HTTP 状态 404 - 请求的资源 (/) 不可用 [英] HTTP Status 404 - The requested resource (/) is not available

查看:223
本文介绍了HTTP 状态 404 - 请求的资源 (/) 不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Eclipse 中集成了 Tomcat 7.当我使用 Eclipse 启动它时,它显示 Tomcat 已启动并正在运行,但是当我转到 http://localhost:8080 在我的浏览器中,它给了我以下错误:

I integrated Tomcat 7 in Eclipse. When I start it using Eclipse, it shows that Tomcat is up and running, but when I go to http://localhost:8080 in my browser, it gives me following error:

输入状态报告

消息/

描述 请求的资源 (/) 不可用.

description The requested resource (/) is not available.

Apache Tomcat/7.0.23

Apache Tomcat/7.0.23

我尝试更改 server.xml 中的端口,以防万一其他服务使用 8080,但它也不起作用.我该如何解决?

I tried changing the port in server.xml just in case if 8080 is used by another service, but it didn't work either. How can I solve it?

推荐答案

你在期待什么?默认的Tomcat主页?如果是这样,您需要配置 Eclipse 以从 Tomcat 接管控制.

What are you expecting? The default Tomcat homepage? If so, you'll need to configure Eclipse to take control over from Tomcat.

双击Servers 选项卡中的Tomcat 服务器条目,您将获得服务器配置.在左栏的Server Locations下,选择Use Tomcat installation(注意,当它变灰时,阅读部分前导文本!;) ).这样 Eclipse 将完全控制 Tomcat,这样当从 Eclipse 内部运行时,您还可以使用 Tomcat 管理器访问默认的 Tomcat 主页.我只是不明白这在使用 Eclipse 进行开发时有什么用处.

Doubleclick the Tomcat server entry in the Servers tab, you'll get the server configuration. At the left column, under Server Locations, select Use Tomcat installation (note, when it is grayed out, read the section leading text! ;) ). This way Eclipse will take full control over Tomcat, this way you'll also be able to access the default Tomcat homepage with the Tomcat Manager when running from inside Eclipse. I only don't see how that's useful while developing using Eclipse.

端口号不是问题.否则,您将在 Tomcat 的启动日志中遇到异常,并且浏览器将显示特定于浏览器的连接超时"错误页面(因此,当 Tomcat 未启动和运行时,不可能提供服务的特定于 Tomcat 的错误页面!)

The port number is not the problem. You would otherwise have gotten an exception in Tomcat's startup log and the browser would show a browser-specific "Connection timed out" error page (and thus not a Tomcat-specific error page which would impossibly be served when Tomcat was not up and running!)

这篇关于HTTP 状态 404 - 请求的资源 (/) 不可用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆