ERROR: transport error 202: bind failed: Address already in use

早上上班,同事反应服务上不去,后台看了一下,发现tomcat挂掉了,重新启动tomcat时报错。

ERROR: transport error 202: bind failed: Address already in use

  

可能是异常关闭,系统没有正常关闭应用的运行环境。

各种调整server.xml里的参数都没有用。

在网上查到两个解决方法,不过都和我实际情况不一致。最后结合二种方法解决问题。

  1. 启动tomcat时ERROR: transport error 202: bind failed: Address already in use server.xml的端口已经改掉.不会产生冲突

在http://forums.terracotta.org/forums/posts/list/857.page找到解决方法

Thanks Orion! That was just the pointer I needed. It turns out that I had a weird bit of leftover configuration in my environment variables that was causing the -Xdebug settings to be mis-configured when they were included during startup. I removed the JAVA_OPTS value from my settings and everything works properly now. Many thanks.

发现在tomcat/bin/catalina.sh中有如下:

CATALINA_OPTS="-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=12343"

 

将 address=12343 改为其他,问题解决…

http://www.codeif.com/post/561/

  1. 今天上预发布。由于将排期模块从jar包依赖的方式独立成http服务,所在copy一份tomcat出来。

结果启动tomcat的时候,直接出现如下错误:

复制代码

1 ERROR: transport error 202: bind failed: Address already in use
2 ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
3 JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:750]
4 FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)

  

ERROR: transport error 202: bind failed: Address already in use

一开始没有仔细看,以为http端口被占用(因为是拷贝过来的tomcat,当然先考虑的就是忘记改配置文件了)。查看端口占用情况,发现http端口并没有被使用,所以又回来仔细看了一下日志。

这是这些年第一次遇到的错误,以前没有类似经历。不过,看着像是远程debug功能开启了导致的端口占用。经过确认,发现startup.sh的最后一行,确实如此:

1 exec "$PRGDIR"/"$EXECUTABLE" jpda start "$@"

最后由于是新上线的应用,所以暂时不需要debug功能。如果是正式环境,debug功能更是不会开启的。所以,改成下面的就可以了(就是关闭tomcat远程调试功能)

1 exec "$PRGDIR"/"$EXECUTABLE"start "$@"

Job done!

来自 <http://www.cnblogs.com/ifudon/p/4750919.html>

解决方法

在bin/startup.sh中最后一行,发现了CATALINA_OPTS设置项,把address改为其他,再重启就正常了。

上一篇:20155324《网络对抗》Exp1 PC平台逆向破解(5)M


下一篇:20155227《网络对抗》Exp1 PC平台逆向破解(5)M