|
From: <tri...@tr...> - 2003-06-22 16:03:52
|
Ken, I have installed the code, but I am having trouble with the connection pool while starting up the application. I have checked everything - username, password, port. I can connect using mysql command line tool, but not using this connection pool. Tried three different versions of MySQL drivers - older versions seems to hang the server, while the most recent one gives a connection error. I am clueless - any ideas? This is the error I get: Apache Tomcat/4.1.10 DBCP borrowObject failed: java.sql.SQLException: Unable to connect to any hosts due to exception: java.net.BindException: Address already in use JDBC Driver: mysql-connector-java-3.0.8-stable-bin.jar This is the server environment: Server Version Apache Tomcat/4.1.10 JVM Version 1.4.0_02-b02 JVM Vendor Sun Microsystems Inc. OS Name Linux OS Version 2.2.20-idepci OS Arch i386 This is the context configuration: <Context className="org.apache.catalina.core.StandardContext" cachingAllowed="true" charsetMapperClass="org.apache.catalina.util.CharsetMapper" cookies="true" crossContext="false" debug="4" displayName="petclinic1" docBase="/home/tom/public_html/www.springframework.org/webapps/petclinic" mapperClass="org.apache.catalina.core.StandardContextMapper" path="/webapps/petclinic" privileged="false" reloadable="true" swallowOutput="false" useNaming="true" wrapperClass="org.apache.catalina.core.StandardWrapper"> <Resource name="jdbc/petclinicMYSQL" auth="Container" type="javax.sql.DataSource"/> <ResourceParams name="jdbc/petclinicMYSQL"> <parameter> <name>factory</name> <value>org.apache.commons.dbcp.BasicDataSourceFactory</value> </parameter> <parameter> <name>validationQuery</name> <value></value> </parameter> <parameter> <name>password</name> <value>xxx</value> </parameter> <parameter> <name>url</name> <value>jdbc:mysql://localhost/spring</value> </parameter> <parameter> <name>driverClassName</name> <value>com.mysql.jdbc.Driver</value> </parameter> <parameter> <name>maxIdle</name> <value>2</value> </parameter> <parameter> <name>username</name> <value>tom</value> </parameter> <parameter> <name>maxActive</name> <value>50</value> </parameter> <parameter> <name>maxIdle</name> <value>10</value> </parameter> <parameter> <name>maxWait</name> <value>10000</value> </parameter> <parameter> <name>removeAbandoned</name> <value>true</value> </parameter> <parameter> <name>removeAbandonedTimeout</name> <value>60</value> </parameter> <parameter> <name>logAbandoned</name> <value>true</value> </parameter> </ResourceParams> </Context> This is from "catalina.out": Jun 22, 2003 11:40:40 AM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on port 8080 Starting service Tomcat-Apache-modjk Apache Tomcat/4.1.10 DBCP borrowObject failed: java.sql.SQLException: Unable to connect to any hosts due to exception: java.net.BindException: Address already in use This is from www.springframework.org-catalina.2003-06-22.log: 2003-06-22 11:54:35 WebappLoader[/wiki]: Deploying class repositories to work directory /usr/local/jakarta-tomcat/4.1.10/work/Standalone/www.springframework.org/wiki 2003-06-22 11:54:35 WebappLoader[/wiki]: Deploy class files /WEB-INF/classes to /usr/local/jakarta-tomcat/4.1.10/work/Standalone/www.springframework.org/wiki/WEB-INF/classes 2003-06-22 11:54:35 WebappLoader[/wiki]: Deploy JAR /WEB-INF/lib/activation.jar to /usr/local/jakarta-tomcat/4.1.10/work/Standalone/www.springframework.org/wiki/WEB-INF/lib/activation.jar 2003-06-22 11:54:35 WebappLoader[/wiki]: Deploy JAR /WEB-INF/lib/commons-beanutils.jar to /usr/local/jakarta-tomcat/4.1.10/work/Standalone/www.springframework.org/wiki/WEB-INF/lib/commons-beanutils.jar 2003-06-22 11:54:35 WebappLoader[/wiki]: Deploy JAR /WEB-INF/lib/commons-fileupload-1.0-dev.jar to /usr/local/jakarta-tomcat/4.1.10/work/Standalone/www.springframework.org/wiki/WEB-INF/lib/commons-fileupload-1.0-dev.jar 2003-06-22 11:54:35 WebappLoader[/wiki]: Deploy JAR /WEB-INF/lib/commons-logging.jar to /usr/local/jakarta-tomcat/4.1.10/work/Standalone/www.springframework.org/wiki/WEB-INF/lib/commons-logging.jar 2003-06-22 11:54:35 WebappLoader[/wiki]: Deploy JAR /WEB-INF/lib/java2html.jar to /usr/local/jakarta-tomcat/4.1.10/work/Standalone/www.springframework.org/wiki/WEB-INF/lib/java2html.jar 2003-06-22 11:54:35 WebappLoader[/wiki]: Deploy JAR /WEB-INF/lib/jstl.jar to /usr/local/jakarta-tomcat/4.1.10/work/Standalone/www.springframework.org/wiki/WEB-INF/lib/jstl.jar 2003-06-22 11:54:35 WebappLoader[/wiki]: Deploy JAR /WEB-INF/lib/jsx.jar to /usr/local/jakarta-tomcat/4.1.10/work/Standalone/www.springframework.org/wiki/WEB-INF/lib/jsx.jar 2003-06-22 11:54:35 WebappLoader[/wiki]: Deploy JAR /WEB-INF/lib/junit.jar to /usr/local/jakarta-tomcat/4.1.10/work/Standalone/www.springframework.org/wiki/WEB-INF/lib/junit.jar 2003-06-22 11:54:35 WebappLoader[/wiki]: Deploy JAR /WEB-INF/lib/log4j.jar to /usr/local/jakarta-tomcat/4.1.10/work/Standalone/www.springframework.org/wiki/WEB-INF/lib/log4j.jar 2003-06-22 11:54:35 WebappLoader[/wiki]: Deploy JAR /WEB-INF/lib/lucene-1.2a.jar to /usr/local/jakarta-tomcat/4.1.10/work/Standalone/www.springframework.org/wiki/WEB-INF/lib/lucene-1.2a.jar 2003-06-22 11:54:36 WebappLoader[/wiki]: Deploy JAR /WEB-INF/lib/mail.jar to /usr/local/jakarta-tomcat/4.1.10/work/Standalone/www.springframework.org/wiki/WEB-INF/lib/mail.jar 2003-06-22 11:54:36 WebappLoader[/wiki]: Deploy JAR /WEB-INF/lib/mysql.jar to /usr/local/jakarta-tomcat/4.1.10/work/Standalone/www.springframework.org/wiki/WEB-INF/lib/mysql.jar 2003-06-22 11:54:36 WebappLoader[/wiki]: Deploy JAR /WEB-INF/lib/standard.jar to /usr/local/jakarta-tomcat/4.1.10/work/Standalone/www.springframework.org/wiki/WEB-INF/lib/standard.jar 2003-06-22 11:54:36 WebappLoader[/wiki]: Deploy JAR /WEB-INF/lib/template4java.jar to /usr/local/jakarta-tomcat/4.1.10/work/Standalone/www.springframework.org/wiki/WEB-INF/lib/template4java.jar 2003-06-22 11:54:37 StandardManager[/wiki]: Seeding random number generator class java.security.SecureRandom 2003-06-22 11:54:37 StandardManager[/wiki]: Seeding of random number generator has been completed 2003-06-22 11:54:37 StandardWrapper[/wiki:default]: Loading container servlet default 2003-06-22 11:54:37 StandardWrapper[/wiki:invoker]: Loading container servlet invoker 2003-06-22 11:54:38 StandardContext[/webapps/petclinic]: Starting 2003-06-22 11:54:38 StandardContext[/webapps/petclinic]: Processing start(), current available=false 2003-06-22 11:54:38 StandardContext[/webapps/petclinic]: Configuring default Resources 2003-06-22 11:54:38 StandardContext[/webapps/petclinic]: Configuring non-privileged default Loader 2003-06-22 11:54:38 StandardContext[/webapps/petclinic]: Configuring default Manager 2003-06-22 11:54:38 StandardContext[/webapps/petclinic]: Processing standard container startup 2003-06-22 11:54:38 WebappLoader[/webapps/petclinic]: Deploying class repositories to work directory /usr/local/jakarta-tomcat/4.1.10/work/Standalone/www.springframework.org/webapps_petclinic 2003-06-22 11:54:38 WebappLoader[/webapps/petclinic]: Deploy class files /WEB-INF/classes to /home/tom/public_html/www.springframework.org/webapps/petclinic/WEB-INF/classes 2003-06-22 11:54:38 WebappLoader[/webapps/petclinic]: Deploy JAR /WEB-INF/lib/commons-logging.jar to /home/tom/public_html/www.springframework.org/webapps/petclinic/WEB-INF/lib/commons-logging.jar 2003-06-22 11:54:38 WebappLoader[/webapps/petclinic]: Deploy JAR /WEB-INF/lib/jstl.jar to /home/tom/public_html/www.springframework.org/webapps/petclinic/WEB-INF/lib/jstl.jar 2003-06-22 11:54:38 WebappLoader[/webapps/petclinic]: Deploy JAR /WEB-INF/lib/log4j-1.2.8.jar to /home/tom/public_html/www.springframework.org/webapps/petclinic/WEB-INF/lib/log4j-1.2.8.jar 2003-06-22 11:54:38 WebappLoader[/webapps/petclinic]: Deploy JAR /WEB-INF/lib/spring-full-0.8.jar to /home/tom/public_html/www.springframework.org/webapps/petclinic/WEB-INF/lib/spring-full-0.8.jar 2003-06-22 11:54:38 WebappLoader[/webapps/petclinic]: Deploy JAR /WEB-INF/lib/standard.jar to /home/tom/public_html/www.springframework.org/webapps/petclinic/WEB-INF/lib/standard.jar 2003-06-22 11:54:38 WebappLoader[/webapps/petclinic]: Reloading checks are enabled for this Context 2003-06-22 11:54:38 ContextConfig[/webapps/petclinic]: ContextConfig: Processing START 2003-06-22 11:54:38 StandardContext[/webapps/petclinic]: Setting deployment descriptor public ID to '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 2003-06-22 11:54:38 StandardContext[/webapps/petclinic]: Setting deployment descriptor public ID to '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 2003-06-22 11:54:38 ContextConfig[/webapps/petclinic]: Accumulating TLD resource paths 2003-06-22 11:54:38 ContextConfig[/webapps/petclinic]: Scanning <taglib> elements in web.xml 2003-06-22 11:54:38 ContextConfig[/webapps/petclinic]: Adding path '/WEB-INF/tlds/spring/i21.tld' for URI '/spring-i21' 2003-06-22 11:54:38 ContextConfig[/webapps/petclinic]: Adding path '/WEB-INF/tlds/jstl/fmt.tld' for URI '/jstl-fmt' 2003-06-22 11:54:38 ContextConfig[/webapps/petclinic]: Adding path '/WEB-INF/tlds/jstl/c.tld' for URI '/jstl-c' 2003-06-22 11:54:38 ContextConfig[/webapps/petclinic]: Scanning TLDs in /WEB-INF subdirectory 2003-06-22 11:54:38 ContextConfig[/webapps/petclinic]: Scanning JARs in /WEB-INF/lib subdirectory 2003-06-22 11:54:38 ContextConfig[/webapps/petclinic]: Adding path '/WEB-INF/lib/commons-logging.jar' 2003-06-22 11:54:38 ContextConfig[/webapps/petclinic]: Adding path '/WEB-INF/lib/jstl.jar' 2003-06-22 11:54:38 ContextConfig[/webapps/petclinic]: Adding path '/WEB-INF/lib/log4j-1.2.8.jar' 2003-06-22 11:54:38 ContextConfig[/webapps/petclinic]: Adding path '/WEB-INF/lib/spring-full-0.8.jar' 2003-06-22 11:54:38 ContextConfig[/webapps/petclinic]: Adding path '/WEB-INF/lib/standard.jar' 2003-06-22 11:54:38 ContextConfig[/webapps/petclinic]: Scanning TLD at resource path '/WEB-INF/tlds/jstl/fmt.tld' 2003-06-22 11:54:38 ContextConfig[/webapps/petclinic]: Scanning JAR at resource path '/WEB-INF/lib/spring-full-0.8.jar' 2003-06-22 11:54:38 ContextConfig[/webapps/petclinic]: Scanning JAR at resource path '/WEB-INF/lib/log4j-1.2.8.jar' 2003-06-22 11:54:38 ContextConfig[/webapps/petclinic]: Scanning TLD at resource path '/WEB-INF/tlds/jstl/c.tld' 2003-06-22 11:54:38 ContextConfig[/webapps/petclinic]: Scanning JAR at resource path '/WEB-INF/lib/commons-logging.jar' 2003-06-22 11:54:38 ContextConfig[/webapps/petclinic]: Scanning JAR at resource path '/WEB-INF/lib/jstl.jar' 2003-06-22 11:54:38 ContextConfig[/webapps/petclinic]: Scanning TLD at resource path '/WEB-INF/tlds/spring/i21.tld' 2003-06-22 11:54:38 ContextConfig[/webapps/petclinic]: Scanning JAR at resource path '/WEB-INF/lib/standard.jar' 2003-06-22 11:54:38 ContextConfig[/webapps/petclinic]: Processing TLD at 'META-INF/sql-rt.tld' 2003-06-22 11:54:38 ContextConfig[/webapps/petclinic]: Processing TLD at 'META-INF/c.tld' 2003-06-22 11:54:38 ContextConfig[/webapps/petclinic]: Processing TLD at 'META-INF/x.tld' 2003-06-22 11:54:38 ContextConfig[/webapps/petclinic]: Processing TLD at 'META-INF/c-rt.tld' 2003-06-22 11:54:38 ContextConfig[/webapps/petclinic]: Processing TLD at 'META-INF/sql.tld' 2003-06-22 11:54:38 ContextConfig[/webapps/petclinic]: Processing TLD at 'META-INF/fmt-rt.tld' 2003-06-22 11:54:38 ContextConfig[/webapps/petclinic]: Processing TLD at 'META-INF/scriptfree.tld' 2003-06-22 11:54:38 ContextConfig[/webapps/petclinic]: Processing TLD at 'META-INF/fmt.tld' 2003-06-22 11:54:39 ContextConfig[/webapps/petclinic]: Processing TLD at 'META-INF/x-rt.tld' 2003-06-22 11:54:39 ContextConfig[/webapps/petclinic]: Processing TLD at 'META-INF/permittedTaglibs.tld' 2003-06-22 11:54:39 ContextConfig[/webapps/petclinic]: Pipline Configuration: 2003-06-22 11:54:39 ContextConfig[/webapps/petclinic]: org.apache.catalina.core.StandardContextValve/1.0 2003-06-22 11:54:39 ContextConfig[/webapps/petclinic]: ====================== 2003-06-22 11:54:39 NamingContextListener[/Standalone/www.springframework.org/webapps/petclinic]: Creating JNDI naming context 2003-06-22 11:54:39 NamingContextListener[/Standalone/www.springframework.org/webapps/petclinic]: Resource parameters for jdbc/petclinicMYSQL = ResourceParams[name=jdbc/petclinicMYSQL, parameters={url=jdbc:mysql://localhost/spring, validationQuery=, maxIdle=10, maxActive=50, maxWait=10000, driverClassName=com.mysql.jdbc.Driver, removeAbandoned=true, username=tom, factory=org.apache.commons.dbcp.BasicDataSourceFactory, logAbandoned=true, removeAbandonedTimeout=60, password=tom}] 2003-06-22 11:54:39 NamingContextListener[/Standalone/www.springframework.org/webapps/petclinic]: Adding resource ref jdbc/petclinicMYSQL 2003-06-22 11:54:39 NamingContextListener[/Standalone/www.springframework.org/webapps/petclinic]: ResourceRef[className=javax.sql.DataSource,factoryClassLocation=null,factoryClassName=org.apache.naming.factory.ResourceFactory,{type=scope,content=Shareable},{type=auth,content=Container},{type=url,content=jdbc:mysql://localhost/spring},{type=validationQuery,content=},{type=maxIdle,content=10},{type=maxActive,content=50},{type=maxWait,content=10000},{type=driverClassName,content=com.mysql.jdbc.Driver},{type=removeAbandoned,content=true},{type=username,content=tom},{type=factory,content=org.apache.commons.dbcp.BasicDataSourceFactory},{type=logAbandoned,content=true},{type=removeAbandonedTimeout,content=60},{type=password,content=tom}] 2003-06-22 11:54:39 NamingContextListener[/Standalone/www.springframework.org/webapps/petclinic]: Resource parameters for UserTransaction = null 2003-06-22 11:54:39 StandardManager[/webapps/petclinic]: Seeding random number generator class java.security.SecureRandom 2003-06-22 11:54:39 StandardManager[/webapps/petclinic]: Seeding of random number generator has been completed 2003-06-22 11:54:39 StandardContext[/webapps/petclinic]: Posting standard context attributes 2003-06-22 11:54:39 StandardContext[/webapps/petclinic]: Configuring application event listeners 2003-06-22 11:54:39 StandardContext[/webapps/petclinic]: Configuring event listener class 'com.interface21.web.context.ContextLoaderListener' 2003-06-22 11:54:39 StandardContext[/webapps/petclinic]: Sending application start events 2003-06-22 11:55:21 StandardContext[/webapps/petclinic]: Exception sending context initialized event to listener instance of class com.interface21.web.context.ContextLoaderListener org.apache.commons.dbcp.DbcpException: java.sql.SQLException: Unable to connect to any hosts due to exception: java.net.BindException: Address already in use at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:85) at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:184) at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(Unknown Source) at org.apache.commons.dbcp.AbandonedObjectPool.borrowObject(AbandonedObjectPool.java:117) at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:110) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:312) at com.interface21.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:133) at com.interface21.jdbc.core.JdbcTemplate.doWithResultSetFromPreparedQuery(JdbcTemplate.java:285) at com.interface21.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:270) at com.interface21.jdbc.object.SqlQuery.execute(SqlQuery.java:121) at com.interface21.jdbc.object.SqlQuery.execute(SqlQuery.java:129) at petclinic.dao.ClinicJdbcDAO.getVets(Unknown Source) at petclinic.ClinicImpl.loadVets(Unknown Source) at petclinic.ClinicImpl.afterPropertiesSet(Unknown Source) at com.interface21.beans.factory.support.AbstractBeanFactory.callLifecycleMethodsIfNecessary(AbstractBeanFactory.java:457) at com.interface21.beans.factory.support.AbstractBeanFactory.createBean(AbstractBeanFactory.java:125) at com.interface21.beans.factory.support.AbstractBeanFactory.getSharedInstance(AbstractBeanFactory.java:171) at com.interface21.beans.factory.support.AbstractBeanFactory.getBeanInternal(AbstractBeanFactory.java:238) at com.interface21.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:219) at com.interface21.beans.factory.support.ListableBeanFactoryImpl.preInstantiateSingletons(ListableBeanFactoryImpl.java:198) at com.interface21.beans.factory.xml.XmlBeanFactory.loadBeanDefinitions(XmlBeanFactory.java:236) at com.interface21.beans.factory.xml.XmlBeanFactory.loadBeanDefinitions(XmlBeanFactory.java:199) at com.interface21.beans.factory.xml.XmlBeanFactory.<init>(XmlBeanFactory.java:149) at com.interface21.context.support.AbstractXmlApplicationContext.refreshBeanFactory(AbstractXmlApplicationContext.java:40) at com.interface21.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:207) at com.interface21.web.context.support.XmlWebApplicationContext.setServletContext(XmlWebApplicationContext.java:120) at com.interface21.web.context.ContextLoader.initContext(ContextLoader.java:56) at com.interface21.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:20) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3251) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3524) at org.apache.catalina.core.ContainerBase.start(ContainerBase.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:2191) at org.apache.catalina.startup.Catalina.start(Catalina.java:510) 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 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) ... 43 more 2003-06-22 11:55:21 StandardContext[/webapps/petclinic]: Context startup failed due to previous errors 2003-06-22 11:55:21 StandardContext[/webapps/petclinic]: Stopping 2003-06-22 11:55:21 StandardContext[/webapps/petclinic]: Stopping filters 2003-06-22 11:55:21 StandardContext[/webapps/petclinic]: Processing standard container shutdown 2003-06-22 11:55:21 ContextConfig[/webapps/petclinic]: ContextConfig: Processing STOP 2003-06-22 11:55:21 StandardContext[/webapps/petclinic]: Sending application stop events 2003-06-22 11:55:21 StandardContext[/webapps/petclinic]: Releasing document base /home/tom/public_html/www.springframework.org/webapps/petclinic 2003-06-22 11:55:21 StandardContext[/webapps/petclinic]: Stopping complete > *To Thomas,* > > Can you install the demo download file along with a running version on > the Spring website, marking it as preliminary ? > > > *To All,* > > I am pleased to announce that I now have ready for download, a new > version of the Petclinic demo app > <http://www.globaldialog.com/%7Ekkrebs/files/petclinic1-1.0.zip>, > approx. 1.9MB. > Be sure to read the file, petclinic.txt which is attached and also is in > the project's websrc directory. This file contains notes regarding the > design, implementation, and usage. > > I am just getting started on the accompanying tutorial. I will post > bits and pieces of it as they become available for review. *Can I get > any volunteers to help with the reviewing ??? > * > I am also happy to say that Sourceforge seems to have worked out their > anonymous access problems so it is using a pretty up-to-date version of > Spring. > > I have it running temporarily on a small, private site. If you wish to > get the URL, send me an email. > > > *To Myself,* > > Time is running out before the symposium (and I leave for a week's > camping holiday in the great north woods of Wisconsin), > so I have to focus on the tutorial. > > Repeat after me: > I must stop designing, coding, tweaking. > I must stop designing, coding, tweaking. > I must stop designing, coding, tweaking. > ... :-) > > > > I very much welcome all comments, suggestions, ideas, criticisms, and etc. > > Ken > |