TOMCAT - HTTP状态404 [英] TOMCAT - HTTP Status 404

查看:2330
本文介绍了TOMCAT - HTTP状态404的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在eclipse中设置我的服务器,当我运行它时,控制台打印:

  mai 02,2013 4:05 :13 PM org.apache.catalina.core.AprLifecycleListener init 
INFO:在java.library.path中找不到基于APR的Apache Tomcat Native库,它允许生产环境中的最佳性能:C:\Program文件\Java\jre7\bin; C:\WINDOWS\Sun\Java\bin; C:\WINDOWS\system32; C:\WINDOWS; C:\WINDOWS\system32;ç :\WINDOWS; C:\WINDOWS\System32\Wbem; c:\Program文件(x86)\Microsoft应用程序虚拟化客户端; c:\Program文件(x86)\打开文本\\ \\bin; C:\WINDOWS\System32\WindowsPowerShell\v1.0\; C:\Program Files\ThinkPad\Bluetooth Software\; C:\Program Files\ThinkPad\Bluetooth Software \syswow64 ;; C:\Program Files(x86)\Intel\OpenCL SDK\2.0\bin\x86; C:\Program文件(x86)\Intel\OpenCL SDK\2.0\bin\x64; C:\Program Files\Java\jre7\bin; C:\WorkspacePPL\apache-maven-3.0。 4\bin ;.
mai 02,2013 4:05:13 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
警告:[SetPropertiesRule] {Server / Service / Engine / Host / Context}设置属性的来源'到'org.eclipse.jst.jee.server:ppl-webapp'没有找到匹配的属性。
mai 02,2013 4:05:13 PM org.apache.coyote.http11.Http11Protocol init
INFO:初始化http-8080上的Coyote HTTP / 1.1
mai 02,2013 4:05 :13 PM org.apache.catalina.startup.Catalina load
INFO:初始化处理604 ms
mai 02,2013 4:05:14 PM org.apache.catalina.core.StandardService start
信息:启动服务Catalina
mai 02,2013 4:05:14 PM org.apache.catalina.core.StandardEngine start
INFO:启动Servlet引擎:Apache Tomcat / 6.0.36
mai 02,2013 4:05:14 PM org.apache.coyote.http11.Http11Protocol start
INFO:在http-8080上启动Coyote HTTP / 1.1
mai 02,2013 4:05:14 PM org.apache.jk.common.ChannelSocket init
INFO:JK:ajp13 listen on /0.0.0.0:8009
mai 02,2013 4:05:14 PM org.apache.jk.server.JkMain start
INFO:Jk running ID = 0 time = 0/22 config = null
mai 02,2013 4:05:14 PM org.apache.catalina.startup.Catalina start
信息:服务器启动在493 ms

但是,如果我浏览 http:// localhost:8080 我得到:

  HTTP状态404  -  / 
------------------------------------------- --------------------------
类型状态报告
消息/
描述请求的资源不可用。

我应该看到Tomcat的欢迎页面。


解决方案


  1. 点击在窗口>显示视图>在服务器视图中右键单击服务器,选择属性。

  2. 在常规面板中,单击切换位置按钮。

  3. 位置:[工作区元数据]应替换为其他内容。

  4. 双击打开服务器的概述屏幕

  5. 在服务器位置选项卡中,选择使用Tomcat位置。

  6. 保存配置并重新启动服务器。 $ b

在启动服务器之前,您可能需要按照上述步骤操作。因为服务器位置部分变灰 - 无法访问。




I set up my server in eclipse and when I run it the console prints:

mai 02, 2013 4:05:13 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre7\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;c:\Program Files (x86)\Microsoft Application Virtualization Client;c:\Program Files (x86)\Open Text\View\bin;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\ThinkPad\Bluetooth Software\;C:\Program Files\ThinkPad\Bluetooth Software\syswow64;;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\Java\jre7\bin;C:\WorkspacePPL\apache-maven-3.0.4\bin;.
mai 02, 2013 4:05:13 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:ppl-webapp' did not find a matching property.
mai 02, 2013 4:05:13 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
mai 02, 2013 4:05:13 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 604 ms
mai 02, 2013 4:05:14 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
mai 02, 2013 4:05:14 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.36
mai 02, 2013 4:05:14 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
mai 02, 2013 4:05:14 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
mai 02, 2013 4:05:14 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/22  config=null
mai 02, 2013 4:05:14 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 493 ms

but then, if I browse http://localhost:8080 I get:

HTTP Status 404 - /
---------------------------------------------------------------------
type Status report
message /
description The requested resource is not available.

While I should see the Tomcat welcome page.

If I run Tomcat outside of eclipse I can reach the welcome page.

解决方案

  1. Click on Window > Show view > Server or right click on the server in "Servers" view, select "Properties".
  2. In the "General" panel, click on the "Switch Location" button.
  3. The "Location: [workspace metadata]" should replace by something else.
  4. Open the Overview screen for the server by double clicking it.
  5. In the Server locations tab , select "Use Tomcat location".
  6. Save the configurations and restart the Server.

You may want to follow the steps above before starting the server. Because server location section goes grayed-unreachable.

这篇关于TOMCAT - HTTP状态404的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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