Tomcat7启动后,网址访问,端口停止

Tomcat7启动后,访问网址,端口总停止

参考下面的问题,得出是

检查/etc/hosts文件中localhost的IP映射,最终的结果如下:
[root@www bin]# more /etc/hosts
 
127.0.0.1 localhost
127.0.0.1 localhostdb
 
网址变了,hosts文件没有及时更新所致。
 
 

网络上参考的文章:

从tomcat 5迁移到tomcat 7遇到的问题

从tomcat 5迁移到tomcat 7遇到的问题

现场环境:
------------------------------------------
CentOS 5.10
JDK 1.7
MYSQL 5.0.24
TOMCAT 7.0

------------------------------------------
问题一:JDBC报错,无法注册成功,具体错误如下:
Mar 26, 2013 1:17:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
SEVERE: The web application [/my_webapp] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
Mar 26, 2013 1:17:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads

解决方法:
由于mysql的jar以前是放在应用的WEB-LIB/lib下,将其移动到tomcat的lib目录下即可解决。

问题二:tomcat自动挂机,服务正常启动,输出的最后日志如下:

INFO: Starting ProtocolHandler ["http-bio-127.0.0.1-8080"]
Nov 22, 2013 4:20:33 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 28227 ms
Nov 22, 2013 4:20:33 PM org.apache.catalina.core.StandardServer await
SEVERE: StandardServer.await: create[localhost:8005]:
java.net.BindException: Cannot assign requested address
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
at java.net.ServerSocket.bind(ServerSocket.java:376)
at java.net.ServerSocket.(ServerSocket.java:237)
at org.apache.catalina.core.StandardServer.await(StandardServer.java:427)
at org.apache.catalina.startup.Catalina.await(Catalina.java:779)
at org.apache.catalina.startup.Catalina.start(Catalina.java:725)
at sun.reflect.NativeMethodAccessorImpl .invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl .invoke(NativeMethodAccessorImpl .java:57)
at sun.reflect.DelegatingMethodAccessor Impl.invoke(DelegatingMethodAccessor Impl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:456)

Nov 22, 2013 4:20:33 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-127.0.0.1-8080"]
Nov 22, 2013 4:20:33 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina

解决方法:
检查/etc/hosts文件中localhost的IP映射,最终的结果如下:
[root@www bin]# more /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain
::1 localhost6.localdomain6 localhost6
127.0.0.1 localhost
127.0.0.1 localhostdb
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值