当Tomcat在Eclipse中运行时,无法打开http:// localhost:8080 / [英] Cannot open http://localhost:8080/ when Tomcat is running in Eclipse

查看:1242
本文介绍了当Tomcat在Eclipse中运行时,无法打开http:// localhost:8080 /的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里提出了同样的问题:我可以打开在浏览器中 http:// localhost:8080 / ,但仍无法访问演示网页..

 <?xml version =1.0encoding =UTF-8?> 
< web-app xmlns:xsi =http://www.w3.org/2001/XMLSchema-instancexmlns =http://java.sun.com/xml/ns/javaeexmlns :web =http://java.sun.com/xml/ns/javaee/web- app_2_5.xsdxsi:schemaLocation =http://java.sun.com/xml/ns/javaee http:// java.sun.com/xml/ns/javaee/web-app_2_5.xsdid =WebApp_IDversion =2.5>
< display-name> SimpleServletProject< / display-name>
< welcome-file-list>
< welcome-file>的index.html< /欢迎-文件>
< / welcome-file-list>
< / web-app>

PS:似乎我没有空间发布index.hmtl(这只是一个正常的html)..

解决方案

你想访问根应用程序(http:// server:port /)但我是很确定Eclipse不会安装根应用程序。尝试在 http:// server:port / yourapp 下访问您在(eclipse托管)tomcat中部署的应用程序。


I got the same problem with the questions here : Tomcat started in eclipse but unable to connect to link to http://localhost:8085/, that means I can't open http://localhost:8080/ at the browser :

HTTP Status 404 - /
type Status report
message /
description The requested resource (/) is not available.
Apache Tomcat/7.0.27

//Console info when tomcat started//

Apr 10, 2012 4:26:32 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to                   org.eclipse.jst.jee.server:SimpleServletProject' did not find a matching property.
Apr 10, 2012 4:26:32 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Apr 10, 2012 4:26:33 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Apr 10, 2012 4:26:33 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 880 ms
Apr 10, 2012 4:26:33 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Apr 10, 2012 4:26:33 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.27
Apr 10, 2012 4:26:33 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Apr 10, 2012 4:26:33 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Apr 10, 2012 4:26:33 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 495 ms

I'm using Tomcat 7.0.27, Eclipse Europa and Java 1.6.0_32. I saw BalusC's answer, but the problem is that I couldn't select Tomcat installation (the picture below).

What could be wrong here?

EDIT1 : When I tried to create demo webpage, it couldn't be opened too (with the same error).

EDIT2: Followed this thread Why tomcat server location property is greyed in Eclipse I can open http://localhost:8080/ in the browser, but still cant access the demo web page..

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"        xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-  app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
    <display-name>SimpleServletProject</display-name>
    <welcome-file-list>
          <welcome-file> index.html</welcome-file>
    </welcome-file-list>
</web-app>

PS : It seems that there's no more space to me to post index.hmtl (it's just a normal html )..

解决方案

You want to access the root application (http://server:port/) but I'm quite sure that Eclipse wont install a root application. Try to access the application you deployed within the (eclipse managed) tomcat under http://server:port/yourapp.

这篇关于当Tomcat在Eclipse中运行时,无法打开http:// localhost:8080 /的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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