在eclipse中运行Tomcat出现的端口占用解决问题方案 。
出现的问题描述如下:
Several ports(8005,8080,8009) required by Tomcat v7.O 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).
依据我的英语水平 , 我看出来了,是一个端口被占用的问题 ,想想 ,应该只要把占用的端口进程终止,问题应该就解决了,这时候的问题有两种解决方案 (如下)。我索性去百度了一下 ,发现问题的解决还是不错的。对着问题的解决方案,我进行了一些收录。
方法1:将端口号为8080的端口,强制性停止。
1 . 首先 ,不要慌,进入dos窗口。(方法我就不说了,win+R -----> 输入 cmd -------> 回车就行了。) 不要问我为什么 , 我们的窗口中显示的位置不同 , 我的是管理员状态下打开的 。
2.在 dos 中输入 netstat ano| findstr 8080 (我要停止的是端口号为8080的进程),之后 , 就出现了如图第一个命令行的反应 。
3.在 输入命令行 taskkill / pid (你端口号对应的PID) /f
4 . 之后 , 问题就解决了。
方法2:修改tomcat默认端口号。
修改Tomcat的配置文件。
例如:C:/tomcat5.5.25/conf/server.xml
<Connector port="8080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" />
Connector 节点,将port="8080"中的端口改为一个没有被占用的端口。