tomcat启动后为什么访问localhost不行,而127.0.0.1就没有问题?郁闷好久了!

luojia1108 2006-04-08 02:10:52
tomcat启动后为什么访问http://localhost:8080不行,而http://127.0.0.1:8080就没有问题?
访问localhost会提示网页无法打开!多次尝试都如此!hosts文件如下:
# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host

127.0.0.1 localhost

高手指点一下!谢了!
...全文
355 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
luojia1108 2006-04-10
  • 打赏
  • 举报
回复
谢谢楼上的!
我现在换了个tomcat 5.0.28都行了!奇怪!原来用tomcat 5.5.15和5.5.16的不行(接上网络就访问不了,断开网络测试就可以)!
我的是XP sp2系统。hosts文件里也有127.0.0.1 localhost
luojunfly 2006-04-10
  • 打赏
  • 举报
回复
我的tomcat也是如此,不知道是不是设了代理的缘故。其实用起来都一样
luojia1108 2006-04-10
  • 打赏
  • 举报
回复
jdk5.0_06的。用是可以,只是想弄明白!呵呵!现在只好用回tomcat 5.0.28的了!
huhbc 2006-04-10
  • 打赏
  • 举报
回复
你用的jdk版本是什么?
Tomcat5.5.x需要jdk5.0
Tomcat5.0.x需要jdk1.4.2

luojia1108 2006-04-10
  • 打赏
  • 举报
回复
与连接上网络有关吗?
lydvqq 2006-04-09
  • 打赏
  • 举报
回复
你找下系统下(2000:c:\winnt\system32\有个hosts文件,用文本打开看有没有:
127.0.0.1 localhost
zcjack 2006-04-09
  • 打赏
  • 举报
回复
不懂,我这里启动 Tomcat后用localhost可以啊
luojia1108 2006-04-09
  • 打赏
  • 举报
回复
没人懂吗?55

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧