[英]Issue with apache tomcat server always running a program its showing that port 8080 is already used..?
Issue with apache tomcat server always running a program its showing that port 8080 is already used.. apache tomcat服务器始终运行程序的问题,它显示端口8080已被使用。
netstat -ano | findstr < Port Number >
taskkill /F /PID < Process Id >
I tried this every time that error is shown the problem is solved. 每当显示错误时,我都会尝试解决问题。
but has to done each time the server to be started or restarted. 但每次启动或重新启动服务器时都必须完成。
I want a permanent solution to resolve this instead of each and every time manually stop the process in 8080.. 我想要一个永久的解决方案来解决此问题,而不是每次都在8080中手动停止该过程。
you could either change the port of the other process to avoid a port conflict, or simply change it in tomcat 您可以更改另一个进程的端口以避免端口冲突,或者只是在tomcat中进行更改
How to change tomcat port number 如何更改tomcat端口号
and change it to something like 8081 并将其更改为8081
Looks like a service automatically starts on each startup, have you had a look between your services which automatically restarts? 看起来服务在每次启动时都会自动启动,您是否看过自动重启的服务?
You can have a look which executable is running on which port with following command (needs admin privileges): 您可以使用以下命令查看哪个可执行文件在哪个端口上运行(需要管理员权限):
netstat -a -b
Got the command from here: How can you find out which process is listening on a port on Windows? 从此处获得命令: 如何找到Windows上正在侦听端口的进程?
and you should have an output like this: 并且您应该有这样的输出:
TCP 0.0.0.0:8080 WS1515:0 LISTENING
[java.exe]
This should give already a hint which process automatically start on each startup, you can have a look in the service tab (you open a run window and input services.msc and press enter) 这应该已经提示每次启动时自动启动哪个进程,您可以在service选项卡中查看(打开运行窗口并输入services.msc并按Enter)
Since you are using netstat, I believe you are using Windows. 由于您使用的是netstat,因此我相信您使用的是Windows。 There are two ways in which you can handle the issue:
有两种方法可以解决此问题:
Disable tomcat service that is running by checking in services.msc. 通过检入services.msc来禁用正在运行的tomcat服务。 You can change the mode of startup from automatic to manual.
您可以将启动模式从自动更改为手动。 This usually happens when you have installed a software using an msi that installs the tomcat service as a part of it.
当您使用msi安装了安装了tomcat服务的msi软件时,通常会发生这种情况。
You can try to change your tomcat server port by editing the following lines in the /conf/server.xml: 您可以尝试通过编辑/conf/server.xml中的以下行来更改tomcat服务器端口:
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443"/>
Change port = 8080
to something else like port = 8082
. 将
port = 8080
更改为port = 8082
。 In that way, you can continue using the customized tomcat without harming any other essential service that has been installed as mentioned in point #1 above 这样,您就可以继续使用自定义的tomcat,而不会损害如上文第1点所述已安装的任何其他基本服务。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.