commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Wilmoth <jonwilm...@yahoo.com>
Subject [dbcp] Connection pooling error w/MySQL
Date Mon, 06 Oct 2003 22:03:30 GMT
I'm attempting a port of a webapp from oracle to mysql
(tight budget ;).  Unfortunately, I'm experiencing
problems with the DataSource implementation provided
with Tomcat 4.1.27 and MySQL that I didn't have with
Tomcat & Oracle.  The error is below.  

I'm able to successfully connect to the MySQL server
via other clients including: MySQL Control Center,
Ant's Sql task and a test java client that has the
following code:

private Connection getConnection() {//load driver	try{
	Class.forName(driverClassName);	} catch
(ClassNotFoundException cnfe) {		log(driverClassName +
" is not in the classpath");		System.exit(1);	}
Connection conn = null;	try {		conn =
DriverManager.getConnection(dbURL, dbUser,dbPwd);	
conn.setAutoCommit(false);	} catch (Exception e) {	
log("getConnection failed to connect to '" + dbURL +
"' with user '" + dbUser + "'", e);		System.exit(1);	}
return conn;}

Any idea why DBCP would have problems?

DBCP borrowObject failed: java.sql.SQLException:
Unable to connect to any hosts due to exception:
java.net.BindException: Address already in use:
connectorg.apache.commons.dbcp.DbcpException:
java.sql.SQLException: Unable to connect to any hosts
due to exception: java.net.BindException: Address
already in use: connect        at
org.apache.commons.dbcp.DriverConnectionFactory.createConnectionDriverConnectionFactory.java:85)
       at
org.apache.commons.dbcp.PoolableConnectionFactory.makeObjectPoolableConnectionFactory.java:184)
       at
org.apache.commons.pool.impl.GenericObjectPool.borrowObjectGenericObjectPool.java:722)
       at
org.apache.commons.dbcp.AbandonedObjectPool.borrowObjectAbandonedObjectPool.java:117)
       at
org.apache.commons.dbcp.PoolingDataSource.getConnectionPoolingDataSource.java:108)
       at
org.apache.commons.dbcp.BasicDataSource.getConnectionBasicDataSource.java:312)
       at
com.apex.chronos.app.DatabaseDelegate.getPooledConnectionDatabaseDelegate.java:70)
       at
com.apex.chronos.app.DatabaseDelegate.logConnectionInfoDatabaseDelegate.java:34)
       at
com.apex.chronos.Startup.testConnectionPool(Startup.java:384)
       at
com.apex.chronos.Startup.init(Startup.java:183)       
at
org.apache.catalina.core.StandardWrapper.loadServletStandardWrapper.java:935)
       at
org.apache.catalina.core.StandardWrapper.loadStandardWrapper.java:823)
       at
org.apache.catalina.core.StandardContext.loadOnStartupStandardContext.java:3421)
       at
org.apache.catalina.core.StandardContext.startStandardContext.java:3609)
       at
org.apache.catalina.core.ContainerBase.startContainerBase.java:1188)
       at
org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
       at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
       at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
       at
org.apache.catalina.core.StandardService.start(StandardService.java:497)
       at
org.apache.catalina.core.StandardServer.start(StandardServer.java:2190)
       at
org.apache.catalina.startup.Catalina.start(Catalina.java:512)
       at
org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
       at
org.apache.catalina.startup.Catalina.process(Catalina.java:180)
       at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at
java.lang.reflect.Method.invoke(Method.java:324)      
 at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)Caused
by: java.sql.SQLException: Unable to connect to any
hosts due to exception: java.net.BindException:
Address already in use: connect        at
com.mysql.jdbc.Connection.createNewIO(Connection.java:1622)
       at
com.mysql.jdbc.Connection.<init>(Connection.java:491) 
      at
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:346)
       at
org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:83)
       ... 27 more

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message