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

早上上班,同事反應服務上不去,後臺看了一下,發現tomcat掛掉了,從新啓動tomcat時報錯。html

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

  

多是異常關閉,系統沒有正常關閉應用的運行環境。java

各類調整server.xml裏的參數都沒有用。tomcat

在網上查到兩個解決方法,不過都和我實際狀況不一致。最後結合二種方法解決問題。jvm

 

  1. 啓動tomcatERROR: transport error 202: bind failed: Address already in use server.xml的端口已經改掉.不會產生衝突

 

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

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中有以下:post

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

 

 

address=12343 改成其餘,問題解決spa

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

  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)

  

複製代碼

一開始沒有仔細看,覺得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改成其餘,再重啓就正常了。

相關文章
相關標籤/搜索