我试图在配置为使用 Tomcat 5.5 的 eclipse 中编写一个 Servlet,当我尝试运行它时出现以下错误:
Several ports (8080, 8009) required by Tomcat v5.5 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 5.5 是使用端口 8080 的,当我转到 http://localhost:8080 时我确实得到了 Tomcat 成功页面,所以看起来 eclipse 试图在不关闭原始 Tomcat 的情况下运行另一个 Tomcat 实例,但失败了。我该如何解决这个问题?
最佳答案
如其所说,某些东西正在使用该端口。
您的问题有两种解决方案。
- 识别(在 Windows 上使用 netstat 命令)什么正在使用端口(例如 skype,...)并停止它
- 在 eclipse 中更改 tomcat 运行时的端口 -> http://techteam.wordpress.com/2009/02/13/changing-the-tomcat-port-settings-in-eclipse/
希望对你有帮助
关于eclipse - 无法使用 Tomcat 运行 Servlet,因为某些东西正在使用端口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4120593/