commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knight, Digby" <>
Subject [DBCP?] BindException connecting to MySQL with a Tomcat DataSourc e
Date Mon, 28 Apr 2003 08:54:40 GMT
(Repost from tomcat-user - apologies if you've seen this there, but I'm
getting desperate).


Just wondering if anyone has come across a BindException when trying to
connect to MySQL (3.2 or 4.0) using a DataSource resource set up in

I can connect quite happily doing a normal Class.forName(...);
DriverManager.getConnection(...),  and I can also get the reference to the
DataSource okay - it just fails when I do the dataSource.getConnection,
giving me the following exception:

"java.sql.SQLException: Unable to connect to any hosts due to exception: Address already in use: connect" 

The stack trace seems to indicate that it's failing somewhere in the DBCP

The odd thing is that I've been connecting quite happily with this method
for months and it's suddenly stopped working, although I'm not sure what I
had just done when it happened - it may have been upgrading to Tomcat
4.1.24, so I might try installing an earlier version. Seems unlikely that
this hasn't been spotted by anyone else though. Netbeans can connect to it
quite happily though, as can mysqladmin, mysqlcc and mysql, although these
get a bit flaky *after* the exception above occurs in my webapp.

Could it be the MySQL Connector/J JDBC driver? I was using the older mm
driver a while ago, although again I can't remember whether that coincided
with the connection failing, and going back to the old driver doesn't help.

Or is it that I've upgraded to WinXP and there are port problems -
everything's on localhost though.

Anyone got any ideas? It's driving me mad.

Thanks in advance.


The information in this email and in any attachments is 
confidential and intended solely for the attention and use 
of the named addressee(s). This information may be 
subject to legal professional or other privilege or may 
otherwise be protected by work product immunity or other 
legal rules.  It must not be disclosed to any person without 
our authority.

If you are not the intended recipient, or a person 
responsible for delivering it to the intended recipient, you 
are not authorised to and must not disclose, copy, 
distribute, or retain this message or any part of it.

View raw message