Tomcat7启动后,访问网址,端口总停止
参考下面的问题,得出是
检查/etc/hosts文件中localhost的IP映射,最终的结果如下:
[root@www bin]# more /etc/hosts
127.0.0.1 localhost
127.0.0.1 localhostdb
网址变了,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
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