java.net.BindException:地址已在使用:JVM_Bind <null>:80
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25742913/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
java.net.BindException: Address already in use: JVM_Bind <null>:80
提问by iamjustcoder
I am getting binding exception while starting the Tomcat server. I tried to kill the process that which is using '80' as couple of processes are using it.
我在启动 Tomcat 服务器时遇到绑定异常。我试图杀死使用“80”的进程,因为有几个进程正在使用它。
Getting error, while killing process id is '0':
获取错误,同时终止进程 ID 为“0”:
ERROR: The process with PID 0 could not be terminated. Reason: This is critical system process. Taskkill cannot end this process.
错误:无法终止 PID 为 0 的进程。原因:这是关键的系统进程。Taskkill 无法结束此过程。
How to fix this?
如何解决这个问题?
I don't need to use another port to run the tomcat server.
我不需要使用另一个端口来运行 tomcat 服务器。
采纳答案by George Papatheodorou
回答by Juned Ahsan
If you have some process listening on port 8080 then you can always configure tomcat to listen on a different port. To change the listener port by editing your server.xml
located under tomcat server conf
directory.
如果您有一些进程在端口 8080 上侦听,那么您始终可以将 tomcat 配置为侦听不同的端口。通过编辑您server.xml
位于 tomcat 服务器conf
目录下来更改侦听器端口。
Search for Connector port="8080"
in server.xml and change the port number to some other port.
Connector port="8080"
在 server.xml 中搜索并将端口号更改为某个其他端口。
回答by S1LENT WARRIOR
The error:
错误:
Tomcat: java.net.BindException: Address already in use: JVM_Bind :80
Tomcat:java.net.BindException:地址已在使用:JVM_Bind :80
suggests that the port 80 is already in use.
You may either:
表明端口 80 已在使用中。
您可以:
- Try searching for that process and stop it OR
- Make your tomcat to run on different (free) port
- 尝试搜索该进程并停止它或
- 让你的 tomcat 在不同的(免费)端口上运行
See also: Deployment error:Starting of Tomcat failed, the server port 8080 is already in use
回答by csaba.sulyok
PID 0 is the System Idle Process, which is surely not listening to port 80. How did you check which process was using the port?
PID 0 是系统空闲进程,它肯定没有侦听端口 80。您如何检查哪个进程正在使用该端口?
You can use
您可以使用
netstat /nao | findstr "80"
to find the PID and check what process it is.
找到PID并检查它是什么进程。
回答by kenorb
The error:
错误:
java.net.BindException: Address already in use: JVM_Bind :80
java.net.BindException:地址已在使用:JVM_Bind :80
means that another application is listening on port 80.
意味着另一个应用程序正在侦听端口 80。
You can check which process is using this port by lsof
command, e.g. sudo lsof -i:80
. Then stop or kill it.
您可以通过lsof
命令检查哪个进程正在使用此端口,例如sudo lsof -i:80
。然后停止或杀死它。
If won't help finding application running on the same port, the common mistake is the Tomcat misconfiguration.
如果不能帮助找到运行在同一端口上的应用程序,常见的错误是 Tomcat 配置错误。
For example by default Tomcat listens on port 8005 for SHUTDOWN command and if you set another Connector to listen on the same port, you'll get port conflict.
例如,默认情况下 Tomcat 在端口 8005 上侦听 SHUTDOWN 命令,如果您将另一个连接器设置为在同一端口上侦听,则会发生端口冲突。
So please double check in server.xml
whether these ports are different:
所以请仔细检查server.xml
这些端口是否不同:
<Server port="8005" shutdown="SHUTDOWN">
<Connector port="8983" protocol="HTTP/1.1"
回答by Lucky
Use the following command to find if your tomcat port is already in use,
使用以下命令查找您的 tomcat 端口是否已被使用,
netstat -a -b
netstat -a -o | findstr :port
For example
例如
netstat -a -o | findstr :8080
Exception:
java.net.BindException: Address already in use: JVM_Bind:80
例外:
java.net.BindException: Address already in use: JVM_Bind:80
means that port 80 is configured by your Tomcat server and it is already used by some other application running on your computer. Please quit Skype if open or change the default port in Skype or other application's port to something other than 80. Or change the tomcat port to something else than 80(e.g. 8080 or 9090) in the server.xml file under the config folder of your tomcat installation directory.
意味着端口 80 是由您的 Tomcat 服务器配置的,并且它已经被您计算机上运行的某些其他应用程序使用。如果打开或将Skype或其他应用程序的默认端口更改为80以外的端口,请退出Skype。 tomcat安装目录。
Exception:
java.net.BindException: Address already in use: JVM_Bind
例外:
java.net.BindException: Address already in use: JVM_Bind
means you din't stop the tomcat server properly and you are trying to start the server again. In Eclipse, the solution for me was to remove the project from the servers tab and right click and run the project as Run on server. This added the project back to the Tomcat 7 and I din't get the BindException error. This was due to closing eclipse the last time you used without stopping the Tomcat server.
意味着您没有正确停止 tomcat 服务器并且您正在尝试再次启动服务器。在 Eclipse 中,我的解决方案是从服务器选项卡中删除项目,然后右键单击并以在服务器上运行的方式运行该项目。这将项目添加回 Tomcat 7,但我没有收到 BindException 错误。这是因为您上次使用时关闭了 eclipse 而没有停止 Tomcat 服务器。
回答by ali
I do a goofy mistake and It take me 2 hour to solve It.I mentioned it here for other persons may be help them.The mistake was I enable ssl connector and changed both https and http ports to same number .
我犯了一个愚蠢的错误,我花了 2 个小时来解决它。我在这里提到它是为了其他人可能会帮助他们。错误是我启用了 ssl 连接器并将 https 和 http 端口更改为相同的数字。
回答by Vineela Thonupunuri
I deleted my server and added it back. IT happened because I shut down the eclipse manually via task manager and it did not shut down the tomcat.
我删除了我的服务器并重新添加了它。发生这种情况是因为我通过任务管理器手动关闭了 eclipse 并且它没有关闭 tomcat。
回答by selvan
C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\conf
C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\conf
Your Port ID in Server.xml File in Source folder is 8080. change the Port Number to 8081...etc
您在 Source 文件夹中 Server.xml 文件中的端口 ID 是 8080。将端口号更改为 8081...等