Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 83864 invoked from network); 6 Oct 2003 22:53:57 -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:53:57 -0000 Received: (qmail 97364 invoked by uid 500); 6 Oct 2003 22:53:38 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 97348 invoked by uid 500); 6 Oct 2003 22:53:38 -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 97335 invoked from network); 6 Oct 2003 22:53:37 -0000 Received: from unknown (HELO web11501.mail.yahoo.com) (216.136.172.46) by daedalus.apache.org with SMTP; 6 Oct 2003 22:53:37 -0000 Message-ID: <20031006225345.88538.qmail@web11501.mail.yahoo.com> Received: from [204.238.150.163] by web11501.mail.yahoo.com via HTTP; Mon, 06 Oct 2003 15:53:45 PDT Date: Mon, 6 Oct 2003 15:53:45 -0700 (PDT) From: Jon Wilmoth Reply-To: jonwilmoth@yahoo.com Subject: Re: [dbcp] Connection pooling error w/MySQL To: Jakarta Commons Users List In-Reply-To: <3F81EDF5.6020507@phreaker.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 Thanks, I've gotten the BindException before when trying to startup two instances of an appserver, but I don't believe Tomcat itself is the problem. Tomcat's running on 8080 and MySQL is running on the default port of 3306. I'm pretty sure there isn't anything else running on 3306 otherwise the MySQL server itself wouldn't be able to startup, let alone the client applications (MySQL Control Center, Ant SQL task, etc.). --- __matthewHawthorne wrote: > 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 > __________________________________ 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