Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 78347 invoked from network); 6 Oct 2003 22:35:10 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 6 Oct 2003 22:35:10 -0000 Received: (qmail 85477 invoked by uid 500); 6 Oct 2003 22:34:52 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 85412 invoked by uid 500); 6 Oct 2003 22:34:51 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 85394 invoked from network); 6 Oct 2003 22:34:51 -0000 Received: from unknown (HELO mr-mcfeeley.fgm.com) (216.1.16.101) by daedalus.apache.org with SMTP; 6 Oct 2003 22:34:51 -0000 Received: from phreaker.net (sd.fgm.com [207.158.2.130]) by mr-mcfeeley.fgm.com (8.11.6/8.11.2) with ESMTP id h96MQeH28913 for ; Mon, 6 Oct 2003 18:26:41 -0400 Message-ID: <3F81EDF5.6020507@phreaker.net> Date: Mon, 06 Oct 2003 15:34:29 -0700 From: __matthewHawthorne User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030901 Thunderbird/0.2 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jakarta Commons Users List Subject: Re: [dbcp] Connection pooling error w/MySQL References: <20031006220330.80942.qmail@web11505.mail.yahoo.com> In-Reply-To: <20031006220330.80942.qmail@web11505.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I've received the "java.net.BindException: Address already in use" error when I attempted to run on a port that was already in use. Perhaps try shutting down your Tomcat and making sure that no other apps are using port 8080 or whichever one you're using. Jon Wilmoth wrote: > 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.(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