简体   繁体   English

与主机的TCP / IP连接失败。 java.net.BindException:已在使用的地址:connect Driver

[英]The TCP/IP connection to the host has failed. java.net.BindException: Address already in use: connect Driver

We deployed an application long back. 我们长期部署了一个应用程序。 It's working fine so far. 它到目前为止工作正常。 Suddenly, we're getting the following error today when the application is trying to connect database. 突然,当应用程序尝试连接数据库时,我们今天收到以下错误。 It's happening on and off. 它正在发生和开启。 some times able to connect. 有时候可以连接。 most often getting below error.what would be the cause. 最经常低于错误。原因是什么。 Please suggest me. 请建议我。 Thanks in advance. 提前致谢。

Error:- 错误:-

com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host  has failed. java.net.BindException: Address already in use: connect
Driver name=com.microsoft.sqlserver.jdbc.SQLServerDriver
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host  has failed. java.net.BindException: Address already in use: connect

You've run out of local ports. 你已经用完了本地端口。 You have a connection leak somewhere, or you're not using a connection pool and you should be. 你有一个连接泄漏,或者你没有使用连接池,你应该。 Check netstat -anp TCP . 检查netstat -anp TCP You will see zillions of connections in ESTABLISHED state to the same target, the MS SQL Server. 您将在ESTABLISHED状态下看到数以万亿计的连接到同一目标,即MS SQL Server。

Address already in use implies that there are not enough ports on the local side available for creating a connection. 已经使用的地址意味着本地端没有足够的端口可用于创建连接。 You would see a lot of entries if you check the network stats. 如果检查网络统计数据,您会看到很多条目。 Assuming it is windows, for the exact way to get the listing, check the platform docs. 假设它是windows,对于获取列表的确切方式,请检查平台文档。 For an understanding of the issue, you can also read: 要了解该问题,您还可以阅读:
http://khanna111.com/articles/TCPAAIU.html http://khanna111.com/articles/TCPAAIU.html

Note that the top 2 figures on that page are jumbled. 请注意,该页面上的前两位数字是混乱的。 There is an explanation of the TIME_WAIT stage as well. 还有TIME_WAIT阶段的解释。

The cause, if you only have that one application doing jdbc running, then the probable cause could be that TCP connections to the database server are being created and either not closed or rate of creating and closing the connections is greater than a threshold that leads to this issue. 原因是,如果您只有一个应用程序正在运行jdbc,则可能的原因可能是正在创建与数据库服务器的TCP连接,并且未关闭或创建和关闭连接的速率大于导致这个问题。 You would need to investigate a connection pool in any case if you do not already have one. 如果您还没有连接池,则需要在任何情况下调查连接池。 If there are other applications on the same host that deal with network traffic then you would need to take a look at those as well. 如果同一主机上有其他应用程序处理网络流量,那么您还需要查看这些应用程序。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 数据库错误:与主机的TCP / IP连接失败。 java.net.BindException:地址已在使用中:connect - database error : The TCP/IP connection to the host has failed. java.net.BindException: Address already in use: connect Apache DefaultHttpClient - java.net.BindException:地址已在使用:连接 - Apache DefaultHttpClient - java.net.BindException: Address already in use: connect Webdriver:java.net.BindException:地址已在使用中:connect - Webdriver: java.net.BindException: Address already in use: connect 无法启动namenode:java.net.BindException:地址已在使用中 - Failed to start the namenode: java.net.BindException: Address already in use java.net.BindException:地址已在使用中 - java.net.BindException: Address already in use 错误:与主机的TCP / IP连接失败。 java.net.ConnectException:连接被拒绝:连接 - Error:The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect Selenium Webdriver:INFO:连接到目标主机时捕获到I / O异常(java.net.BindException):已在使用地址:connect - Selenium Webdriver: INFO: I/O exception (java.net.BindException) caught when connecting to the target host: Address already in use: connect Java Linux:java.net.BindException:地址已在使用中 - Java Linux: java.net.BindException: Address already in use Hadoop-java.net.BindException:地址已在使用中 - Hadoop - java.net.BindException: Address already in use 如何解决java.net.BindException:地址已在使用中 - How to solve java.net.BindException: Address already in use
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM