Is this a bug? java.net.BindException: Address already in use: connect

From: "Michael Mattox" <michael(dot)mattox(at)verideon(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Is this a bug? java.net.BindException: Address already in use: connect
Date: 2003-06-18 15:05:01
Message-ID: CJEBLDCHAADCLAGIGCOOKEHBCKAA.michael.mattox@verideon.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm getting a "java.net.BindException: Address already in use" error while
load testing my application, the line causing the error is:

try {
con =
DriverManager.getConnection(
url,
properties.getProperty(IGlobalKeys.JDBC_USERNAME),
properties.getProperty(IGlobalKeys.JDBC_PASSWORD));

And in the finally block I have:

} finally {
try {
if (con != null && !con.isClosed())
con.close();
} catch (SQLException e) {
}
}

I'm not sure why or how the DriverManager is getting a connection that's
already in use. I'm using PostgreSQL 7.3.2 with Cygwin on Windows 2000 with
the pg73jdbc3.jar driver and JDK 1.4.1_03. Here's the stack trace:

The connection attempt failed because Exception: java.net.BindException:
Address already in use: connect
Stack Trace:

java.net.BindException: Address already in use: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:434)
at java.net.Socket.connect(Socket.java:384)
at java.net.Socket.<init>(Socket.java:291)
at java.net.Socket.<init>(Socket.java:119)
at org.postgresql.PG_Stream.<init>(PG_Stream.java:38)
at
org.postgresql.jdbc1.AbstractJdbc1Connection.openConnection(AbstractJdbc1Con
nection.java:160)
at org.postgresql.Driver.connect(Driver.java:122)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at
com.verideon.veriguard.services.ReportService.getMonitorStatus(ReportService
.java:293)

Browse pgsql-general by date

  From Date Subject
Next Message scott.marlowe 2003-06-18 15:10:01 Re: Linux supports hot-swappable hardware? [was Re:
Previous Message Paul Thomas 2003-06-18 15:04:55 Re: PostgreSQL alternative to "Oracle Real Application Cluster"