在企业版Eclipse中,在已经启动了Tomcat服务器后,准备运行页面或Servlet时,有时会出现这样的关于Tomcat服务器端口占用的问题:
“Several ports (8005, 8080, 8009) required by Tomcat v6.0 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).”
“Several ports (8005, 8080, 8009) required by Tomcat v6.0 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).”

错误信息的大意是说Tomcat运行所需的那三个端口被的程序占用了。
cmd.exe 命令行窗口以管理员身份运行,在控制台输入 netstat -abn”命令查看正在运行的程序所占用的端口以及相关信息:
可以看到,是"javaw.exe"这个程序占用了8009和8080端口,在资源管理器中把它结束掉就可以了。