最代码官方的gravatar头像
最代码官方 2016-04-19 14:46:05

windows7下idea运行tomcat为什么抛出java.net.BindException: Address already in use: JVM_Bind异常?

最近通过idea开发java web项目,但是idea经常自动关闭,再打开idea后启动tomcat时抛出异常:

java.net.BindException: Address already in use: JVM_Bind

D:\apache-tomcat-7.0.8\bin\catalina.bat run
[2016-04-19 02:43:14,204] Artifact zuidaima_video:war: Server is not connected. Deploy is not available.
Using CATALINA_HOME:   "D:\apache-tomcat-7.0.8"
Using CATALINA_TMPDIR: "D:\apache-tomcat-7.0.8\temp"
Using JRE_HOME:        "C:\Program Files\Java\jdk1.7.0_21"
Using CLASSPATH:       "D:\apache-tomcat-7.0.8\bin\bootstrap.jar;D:\apache-tomcat-7.0.8\bin\tomcat-juli.jar"
Connected to the target VM, address: '127.0.0.1:65301', transport: 'socket'
错误: 代理抛出异常错误: java.rmi.server.ExportException: Port already in use: 1099; nested exception is: 
	java.net.BindException: Address already in use: JVM_Bind
Disconnected from the target VM, address: '127.0.0.1:65301', transport: 'socket'
Disconnected from server

该如何解决呢?

所有回答列表(4)
最代码官方的gravatar头像
最代码官方  LV167 2016年4月19日

由于idea异常关闭,但是tomcat进程却还在运行,所以启动tomcat时提示这个错误:

windows7下idea运行tomcat为什么抛出java.net.BindException: Address already in use: JVM_Bind异常?

只需要找到这个端口对应的进程id,kill掉即可

windows下

netstat -aon|findstr "1099"

windows7下idea运行tomcat为什么抛出java.net.BindException: Address already in use: JVM_Bind异常?

taskkill /f /pid 9252

windows7下idea运行tomcat为什么抛出java.net.BindException: Address already in use: JVM_Bind异常?

对于linux或unix下的情况类似,请自行研究。

评论(0) 最佳答案
limtno的gravatar头像
limtno  LV23 2016年4月19日

idea经常自动关闭有两种情况,一种机器分配给idea的内存不够了,会异常退出,还有一种,在idea的启动配置properties中配置的各种堆栈内存不合理造成idea退出,这两种都可以通过跟踪idea的内存占用来合理分配,避免这种异常退出,不然正在调试代码突然idea不见了。。。

最代码温柔的gravatar头像
最代码温柔  LV18 2016年4月23日

有三个解决途径。

1.杀掉tomcat的端口进程。

2.修改tomcat的配置,更改新的端口号

3.重启电脑就好了

wangyifan1100的gravatar头像
wangyifan1100  LV6 2016年5月13日

JVM_Bind. 这个错误。我每次启动Tomcat都报这错。因为我的Tomcat每次开机自动启动。导致端口被占用。

顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友