2

我在我的计算机上安装了 tomcat v6.0,我正在尝试访问一个网页。我添加了一个 SVN 到 Eclipse 的项目。当我尝试将它作为服务器运行时,它会给出以下页面:

HTTP Status 404 - /first/

--------------------------------------------------------------------------------

type Status report

message /first/

description The requested resource is not available.


--------------------------------------------------------------------------------

Apache Tomcat/6.0.37

同样在控制台上记录这些:

02.Tem.2013 16:36:45 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\jre6\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Perl\site\bin;C:\Perl\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\mingw\bin;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files\nodejs\;C:\Python27;C:\Python27\Scripts;C:\GNUstep\GNUstep\System\Tools;C:\Users\HasanFerit\AppData\Roaming\npm;.
02.Tem.2013 16:36:45 org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property    'source' to 'org.eclipse.jst.jee.server:first' did not find a matching property.
02.Tem.2013 16:36:45 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
02.Tem.2013 16:36:45 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 586 ms
02.Tem.2013 16:36:45 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
02.Tem.2013 16:36:45 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.37
02.Tem.2013 16:36:46 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
02.Tem.2013 16:36:46 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
02.Tem.2013 16:36:46 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/14  config=null
02.Tem.2013 16:36:46 org.apache.catalina.startup.Catalina start
INFO: Server startup in 480 ms

然后我尝试打开 localhost:8080,我也不工作......它打开了同一个页面。我不工作。什么会导致这个问题?你能帮助我吗?

4

2 回答 2

1

当您从 Eclipse 运行 Tomcat 时,它不会在localhost:8080/. 在 Eclipse 之外运行它以查看该页面。

至于您的项目,请检查WEB-INF/web.xml文件以查看welcome-file-list. Tomcat 检查该列表以尝试解析对 Web 应用根目录的请求。

于 2013-07-02T21:18:04.853 回答
0

If you did not change anything in your Tomcat conf/server.xml, a properly running Tomcat server should show you a Tomcat page on http://localhost:8080 with the message "If you're seeing this, you've successfully installed Tomcat. Congratulations!".

Make sure you set the following environment variables correctly JAVA_HOME, JRE_HOME, and CATALINA_HOME. Instructions for Mac, Instructions for Windows

If you needed to add / change one of those, make sure the changes are applied (e.g. on Windows you can log off and login again, on Mac / Unix you can run source ~/.bash_profile from the Terminal).

Now open a terminal (Terminal on Mac, cmd.exe on Windows) and start Tomcat by running:

  • Windows: %CATALINA_HOME%\bin\startup.bat
  • Mac: $CATALINA_HOME/bin/startup.sh

In the terminal / console, you should see something like:

Using CATALINA_BASE:   ...
Using CATALINA_HOME:   ...
Using CATALINA_TMPDIR: ...
Using JRE_HOME:        ...
Using CLASSPATH:       ...

Now, try opening http://localhost:8080 in a browser. It should show you the Tomcat page as described above.

于 2015-12-14T16:25:13.453 回答