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

Spring JIRA | Paweł Jojczyk | 4 years ago
  1. 0

    Number of sockets available for a JDBC connection at Windows 2003

    Stack Overflow | 8 years ago | Dema
    java.net.BindException: Address already in use: connect
  2. 0

    java.net.BindException: Address already in use: connect - Spring Forum

    spring.io | 4 months ago
    java.net.BindException: Address already in use: connect
  3. 0

    We use following mvn configuration: <dependency> <groupId>com.gemstone.gemfire</groupId> <artifactId>gemfire</artifactId> <version>6.6.3.2</version> </dependency> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-gemfire</artifactId> <version>1.1.2.RELEASE</version> </dependency> We also tried with: - gemfire 6.6.2 and spring-data-gemfire 1.1.0.RELEASE (Client & Server) - gemfire 6.6.3.2 and spring-data-gemfire 1.1.2.RELEASE (Client & Server) - Client: gemfire 6.6.3.2 and spring-data-gemfire 1.2.0.M1 Server: gemfire 6.6.3.2 and spring-data-gemfire 1.1.2.RELEASE Basing on i.e.: http://www.gemstone.com/docs/html/gemfire/6.0.0/DevelopersGuide/ClientServerBasics.8.8.html and http://www.gemstone.com/docs/html/gemfire/6.0.0/DevelopersGuide/ClientServerAdvancedTopics.9.24.html#2082966): we set spring bean configuration of pool as follows: <bean id="mdfGemfireFunctionService" class="com.ubs.opsit.cstr.core.external.mdf.MdfGemfireFunctionService"/> <gfe:client-cache id="mdfGemfireClient" pool-name="poolToConsume" cache-xml-location="gemfire-client.xml"/> <gfe:pool id="poolToConsume" subscription-enabled="true" read-timeout="60000" retry-attempts="2"> <gfe:locator host="localhost" port="4041"/> </gfe:pool> <gfe:lookup-region id="mdfPartnerRegion" name="Partner-V5" cache-ref="mdfGemfireClient"/> <gfe:lookup-region id="mdfTradingAccountRegion" name="TradingAccount-V5" cache-ref="mdfGemfireClient"/> <gfe:lookup-region id="mdfProductRegion" name="Product" cache-ref="mdfGemfireClient"/> <bean lazy-init="true" id="mdfGemfirePartnerRegionTemplate" class="org.springframework.data.gemfire.GemfireTemplate"> <property name="region" ref="mdfPartnerRegion"/> </bean> <bean lazy-init="true" id="mdfGemfireTradingAccountRegionTemplate" class="org.springframework.data.gemfire.GemfireTemplate"> <property name="region" ref="mdfTradingAccountRegion"/> </bean> And gemfire-client.xml: <client-cache> <pdx read-serialized="true"/> <region name="Partner-V5"> <region-attributes refid="PROXY"/> </region> <region name="TradingAccount-V5"> <region-attributes refid="PROXY"/> </region> <region name="Product"> <region-attributes refid="PROXY"/> </region> </client-cache> (Our environment is: client---locator---server) When (inside client) we execute code like: FunctionService.onServers(pool).execute() and server processing is longer than 60s, exception is thrown in client code (which is what we expect) so that we are able to react somehow. However, if we do simmilar invocation, but on region: FunctionService.onRegion(region).execute() there is no exception thrown, so if server hangs, client thread waits forever (effectively we lose thread). This seems to be a bug - my uderstanding of docs is that client API should try for 60s, then throw exception for region as well, since timeout is set on pool used to access this region. (please correct me if I'm wrong) Below commented snippet of client logs: 31.08.12 18:41:53,024 INFO Some log from other modules -- here client ivocation occurs and server thread starts to process forever -- [warning 2012/08/31 18:42:58.368 CEST <poolTimer-poolToConsume-35> tid=0x2b5] Pool unexpected socket timed out on client connection=SubscriptionConnectionImpl[host.ip.addr:1215:closed]). Server unreachable: could not connect after 1 attempts [warning 2012/08/31 18:42:58.368 CEST <BusinessProcessAdapter_RealtimeReportingGroup_1346430895498-Processor-4-1346430895607> tid=0x1f4] Pool unexpected SocketException connection=Pooled Connection to host.ip.addr:1215: Connection[DESTROYED]). Server unreachable: could not connect after 1 attempts [warning 2012/08/31 18:43:08.573 CEST <poolTimer-poolToConsume-44> tid=0x2b7] Pool unexpected socket timed out on client connection=SubscriptionConnectionImpl[host.ip.addr:1215:closed]). Server unreachable: could not connect after 1 attempts -- here client thread starts to hang waiting for server response -- -- here server thread finishes -- [info 2012/08/31 18:44:10.386 CEST <Cache Client Updater Thread on host<v5>:43775/1205> tid=0x2c7] Cache Client Updater Thread on host<v5>:43775/1205 (host.ip.addr:1215) : ready to process messages. 31.08.12 18:44:14,066 INFO Other logs... ================= Also looks like after longer waiting, some resouces are completly spent. Observed on Client version 1.2.0.RC1 (connected to 1.1.2, both with gemfire 6.6.3.2) constantly throwing exception: On client console: [info 2012/09/03 13:52:33.651 CEST <BusinessProcessAdapter_RealtimeReportingGroup_1346670098244-Processor-2-1346670098338> tid=0x182] Communication with locator /localhost:4041 failed with java.net.BindException: Address already in use: connect. java.net.BindException: Address already in use: connect at java.net.PlainSocketImpl.socketConnect(Native Method) ... On locator console: [info 2012/09/03 13:51:24.674 CEST <Timer-2> tid=0x17] Could not connect to distribution locator host<v0>:4041: java.net.BindException: Address already in use: connect This may occur on lower client as well (didn't try to verify) [host address obfuscated]

    Spring JIRA | 4 years ago | Paweł Jojczyk
    java.net.BindException: Address already in use: connect
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    We use following mvn configuration: <dependency> <groupId>com.gemstone.gemfire</groupId> <artifactId>gemfire</artifactId> <version>6.6.3.2</version> </dependency> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-gemfire</artifactId> <version>1.1.2.RELEASE</version> </dependency> We also tried with: - gemfire 6.6.2 and spring-data-gemfire 1.1.0.RELEASE (Client & Server) - gemfire 6.6.3.2 and spring-data-gemfire 1.1.2.RELEASE (Client & Server) - Client: gemfire 6.6.3.2 and spring-data-gemfire 1.2.0.M1 Server: gemfire 6.6.3.2 and spring-data-gemfire 1.1.2.RELEASE Basing on i.e.: http://www.gemstone.com/docs/html/gemfire/6.0.0/DevelopersGuide/ClientServerBasics.8.8.html and http://www.gemstone.com/docs/html/gemfire/6.0.0/DevelopersGuide/ClientServerAdvancedTopics.9.24.html#2082966): we set spring bean configuration of pool as follows: <bean id="mdfGemfireFunctionService" class="com.ubs.opsit.cstr.core.external.mdf.MdfGemfireFunctionService"/> <gfe:client-cache id="mdfGemfireClient" pool-name="poolToConsume" cache-xml-location="gemfire-client.xml"/> <gfe:pool id="poolToConsume" subscription-enabled="true" read-timeout="60000" retry-attempts="2"> <gfe:locator host="localhost" port="4041"/> </gfe:pool> <gfe:lookup-region id="mdfPartnerRegion" name="Partner-V5" cache-ref="mdfGemfireClient"/> <gfe:lookup-region id="mdfTradingAccountRegion" name="TradingAccount-V5" cache-ref="mdfGemfireClient"/> <gfe:lookup-region id="mdfProductRegion" name="Product" cache-ref="mdfGemfireClient"/> <bean lazy-init="true" id="mdfGemfirePartnerRegionTemplate" class="org.springframework.data.gemfire.GemfireTemplate"> <property name="region" ref="mdfPartnerRegion"/> </bean> <bean lazy-init="true" id="mdfGemfireTradingAccountRegionTemplate" class="org.springframework.data.gemfire.GemfireTemplate"> <property name="region" ref="mdfTradingAccountRegion"/> </bean> And gemfire-client.xml: <client-cache> <pdx read-serialized="true"/> <region name="Partner-V5"> <region-attributes refid="PROXY"/> </region> <region name="TradingAccount-V5"> <region-attributes refid="PROXY"/> </region> <region name="Product"> <region-attributes refid="PROXY"/> </region> </client-cache> (Our environment is: client---locator---server) When (inside client) we execute code like: FunctionService.onServers(pool).execute() and server processing is longer than 60s, exception is thrown in client code (which is what we expect) so that we are able to react somehow. However, if we do simmilar invocation, but on region: FunctionService.onRegion(region).execute() there is no exception thrown, so if server hangs, client thread waits forever (effectively we lose thread). This seems to be a bug - my uderstanding of docs is that client API should try for 60s, then throw exception for region as well, since timeout is set on pool used to access this region. (please correct me if I'm wrong) Below commented snippet of client logs: 31.08.12 18:41:53,024 INFO Some log from other modules -- here client ivocation occurs and server thread starts to process forever -- [warning 2012/08/31 18:42:58.368 CEST <poolTimer-poolToConsume-35> tid=0x2b5] Pool unexpected socket timed out on client connection=SubscriptionConnectionImpl[host.ip.addr:1215:closed]). Server unreachable: could not connect after 1 attempts [warning 2012/08/31 18:42:58.368 CEST <BusinessProcessAdapter_RealtimeReportingGroup_1346430895498-Processor-4-1346430895607> tid=0x1f4] Pool unexpected SocketException connection=Pooled Connection to host.ip.addr:1215: Connection[DESTROYED]). Server unreachable: could not connect after 1 attempts [warning 2012/08/31 18:43:08.573 CEST <poolTimer-poolToConsume-44> tid=0x2b7] Pool unexpected socket timed out on client connection=SubscriptionConnectionImpl[host.ip.addr:1215:closed]). Server unreachable: could not connect after 1 attempts -- here client thread starts to hang waiting for server response -- -- here server thread finishes -- [info 2012/08/31 18:44:10.386 CEST <Cache Client Updater Thread on host<v5>:43775/1205> tid=0x2c7] Cache Client Updater Thread on host<v5>:43775/1205 (host.ip.addr:1215) : ready to process messages. 31.08.12 18:44:14,066 INFO Other logs... ================= Also looks like after longer waiting, some resouces are completly spent. Observed on Client version 1.2.0.RC1 (connected to 1.1.2, both with gemfire 6.6.3.2) constantly throwing exception: On client console: [info 2012/09/03 13:52:33.651 CEST <BusinessProcessAdapter_RealtimeReportingGroup_1346670098244-Processor-2-1346670098338> tid=0x182] Communication with locator /localhost:4041 failed with java.net.BindException: Address already in use: connect. java.net.BindException: Address already in use: connect at java.net.PlainSocketImpl.socketConnect(Native Method) ... On locator console: [info 2012/09/03 13:51:24.674 CEST <Timer-2> tid=0x17] Could not connect to distribution locator host<v0>:4041: java.net.BindException: Address already in use: connect This may occur on lower client as well (didn't try to verify) [host address obfuscated]

    Spring JIRA | 4 years ago | Paweł Jojczyk
    java.net.BindException: Address already in use: connect
  6. 0

    BindException: Address already in use - With many outbound connections

    Stack Overflow | 2 years ago | mark
    java.net.BindException: Address already in use: connect

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.net.BindException

      Address already in use: connect

      at java.net.PlainSocketImpl.socketConnect()
    2. Java RT
      PlainSocketImpl.socketConnect
      1. java.net.PlainSocketImpl.socketConnect(Native Method)
      1 frame