commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hope, Matthew" <Matthew.H...@capitalone.com>
Subject RE: [DBCP]: Tomcat+MySQL. Intermitent DbcpException: Server confi guration -&gt; Now pool exhausted
Date Tue, 26 Aug 2003 10:32:54 GMT
how many threads are you allowing and is it more than the max number of
database connections?

> -----Original Message-----
> From: Monica Ferrero [mailto:monicaf@activehotels.com] 
> Sent: 26 August 2003 11:10
> To: commons-user@jakarta.apache.org
> Subject: Re: [DBCP]: Tomcat+MySQL. Intermitent DbcpException: 
> Server configuration -&gt; Now pool exhausted
> 
> 
> Hello!
> 
> As far as I know all my result sets, statements and 
> connections are closed
> in the finally block of my try stament where all the SQL 
> related queries
> are done.
> Even if an exception is thrown in the middle the finally 
> statement should
> be executed and everything be closed.
> 
> Monica
> 
> > Make sure the rs, stmt and conn are closed in the finally 
> block in your
> >  code.
> > Brian
> >
> > Perhaps an exception is being thrown along the way after a conn is
> > obtained, but thenconn is not closed because code is never reached.
> >
> > On Fri, 22 Aug 2003 10:58AM -0500, Monica Ferrero wrote:
> >> Hello!
> >>
> >> Sorry not to have given any signs of life...
> >> Yes, I got an answer in the mySQL list, that pointed out that my
> >> number  of
> >> connections 500, was a lot more than the normal value of 
> 100. Changing
> >>  that
> >> solved the problem of the Server configuration error, but I've gone
> >> back to
> >> getting java.sql.SQLException: DBCP could not obtain an idle db
> >> connection,
> >> pool exhausted (whole exception follows).
> >> I thought the configuration
> >>         <parameter>
> >>           <name>logAbandoned</name>
> >>           <value>true</value>
> >>         </parameter>
> >>         <parameter>
> >>           <name>removeAbandoned</name>
> >>           <value>true</value>
> >>         </parameter>
> >> would free and log abandoned connections, but it doesn't seem to do
> >> it. Anyway, I have checked over all my result sets, statements and
> >> connections
> >> and I think they are all closed properly...
> >>
> >> So I'm still a bit stuck here...
> >> Some other person in this list, suggested that there might be some
> >> problems
> >> with the DBCP, could it be so?
> >> Any other suggestions?
> >>
> >> Any help really appreciated.
> >>
> >> Monica
> >>
> >> 2003-08-20 04:04:57 ApplicationDispatcher[] Servlet.service() for
> >> servlet
> >> StructureServlet threw exception
> >> javax.servlet.ServletException: Error initialising boxes
> >>         at
> >> com.ah.auk.core.BoxManager.configureBoxes(BoxManager.java:72)
> >>         at com.ah.auk.structure.StructureServlet.doGet
> >> (StructureServlet.java:88)
> >>         at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java) at
> >>         javax.servlet.http.HttpServlet.service(HttpServlet.java) at
> >> org.apache.catalina.core.ApplicationDispatcher.invoke(Unknown
> >> Source)
> >>         at
> >> org.apache.catalina.core.ApplicationDispatcher.doForward(Unknown
> >> Source)
> >>         at
> >> org.apache.catalina.core.ApplicationDispatcher.forward(Unknown
> >> Source)
> >>         at
> >> org.apache.catalina.valves.ErrorDispatcherValve.custom(Unknown
> >> Source)
> >>         at
> >> org.apache.catalina.valves.ErrorDispatcherValve.status(Unknown
> >> Source)
> >>         at
> >> org.apache.catalina.valves.ErrorDispatcherValve.invoke(Unknown
> >> Source)
> >>         at
> >>
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invok
> >> eNext(Unknown Source)
> >>         at 
> org.apache.catalina.valves.ErrorReportValve.invoke(Unknown
> >> Source)
> >>         at
> >>
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invok
> >> eNext(Unknown Source)
> >>         at org.apache.catalina.core.StandardPipeline.invoke(Unknown
> >> Source)
> >>         at org.apache.catalina.core.ContainerBase.invoke(Unknown
> >> Source)
> >>         at 
> org.apache.catalina.core.StandardEngineValve.invoke(Unknown
> >> Source)
> >>         at
> >>
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invok
> >> eNext(Unknown Source)
> >>         at org.apache.catalina.core.StandardPipeline.invoke(Unknown
> >> Source)
> >>         at org.apache.catalina.core.ContainerBase.invoke(Unknown
> >> Source)
> >>         at org.apache.coyote.tomcat4.CoyoteAdapter.service
> >> (CoyoteAdapter.java:223)
> >>         at org.apache.jk.server.JkCoyoteHandler.invoke
> >> (JkCoyoteHandler.java:261)
> >>         at org.apache.jk.common.HandlerRequest.invoke
> >> (HandlerRequest.java:360)
> >>         at
> >> org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:604)
> >>         at org.apache.jk.common.ChannelSocket.processConnection
> >> (ChannelSocket.java:562)
> >>         at org.apache.jk.common.SocketConnection.runIt
> >> (ChannelSocket.java:679)
> >>         at
> >> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
> >> (ThreadPool.java:619)
> >>         at java.lang.Thread.run(Thread.java:534)
> >> ----- Root Cause -----
> >> com.ah.auk.core.BoxException: java.sql.SQLException: DBCP could not
> >> obtain
> >> an idle db connection, pool exhausted
> >>         at
> >> com.ah.auk.box.CountyListBox.configure(CountyListBox.java:80)
> >>         at
> >> com.ah.auk.core.BoxManager.configureBoxes(BoxManager.java:41)
> >>         at com.ah.auk.structure.StructureServlet.doGet
> >> (StructureServlet.java:88)
> >>         at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java) at
> >>         javax.servlet.http.HttpServlet.service(HttpServlet.java) at
> >> org.apache.catalina.core.ApplicationDispatcher.invoke(Unknown
> >> Source)
> >>         at
> >> org.apache.catalina.core.ApplicationDispatcher.doForward(Unknown
> >> Source)
> >>         at
> >> org.apache.catalina.core.ApplicationDispatcher.forward(Unknown
> >> Source)
> >>         at
> >> org.apache.catalina.valves.ErrorDispatcherValve.custom(Unknown
> >> Source)
> >>         at
> >> org.apache.catalina.valves.ErrorDispatcherValve.status(Unknown
> >> Source)
> >>         at
> >> org.apache.catalina.valves.ErrorDispatcherValve.invoke(Unknown
> >> Source)
> >>         at
> >>
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invok
> >> eNext(Unknown Source)
> >>         at 
> org.apache.catalina.valves.ErrorReportValve.invoke(Unknown
> >> Source)
> >>         at
> >>
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.invok
> >> eNext(Unknown Source)
> >>         at org.apache.catalina.core.StandardPipeline.invoke(Unknown
> >> Source)
> >>         at org.apache.catalina.core.ContainerBase.invoke(Unknown
> >> Source)
> >>         at org.apache.coyote.tomcat4.CoyoteAdapter.service
> >> (CoyoteAdapter.java:223)
> >>         at org.apache.jk.server.JkCoyoteHandler.invoke
> >> (JkCoyoteHandler.java:261)
> >>         at org.apache.jk.common.HandlerRequest.invoke
> >> (HandlerRequest.java:360)
> >>         at
> >> org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:604)
> >>         at org.apache.jk.common.ChannelSocket.processConnection
> >> (ChannelSocket.java:562)
> >>         at org.apache.jk.common.SocketConnection.runIt
> >> (ChannelSocket.java:679)
> >>         at
> >> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
> >> (ThreadPool.java:619)
> >>         at java.lang.Thread.run(Thread.java:534)
> >> Caused by: java.sql.SQLException: DBCP could not obtain an idle db
> >> connection, pool exhausted
> >>         at org.apache.commons.dbcp.AbandonedObjectPool.borrowObject
> >> (AbandonedObjectPool.java:123)
> >>         at org.apache.commons.dbcp.PoolingDataSource.getConnection
> >> (PoolingDataSource.java:110)
> >>         at org.apache.commons.dbcp.BasicDataSource.getConnection
> >> (BasicDataSource.java:312)
> >>         at com.ah.auk.db.DBUtil.getDBConnection(DBUtil.java:54)
> >>         at com.ah.auk.db.DB.checkDBCon(DB.java:36)
> >>         at 
> com.ah.auk.db.GeoDBReader.getGeoId(GeoDBReader.java:40) at
> >> com.ah.auk.box.CountyListBox.getCountryId(CountyListBox.java:160)
> >>         at
> >> com.ah.auk.box.CountyListBox.configure(CountyListBox.java:57)
> >>         ... 27 more
> >>
> >>
> >>
> >>>  Hi Monica
> >>>
> >>>  Did the solution you got on this list solve your problem ?
> >>>  http://weblists.camelot.co.pt/10/10093.html?grp=
> >>>
> >>>  Or is there still something wrong?
> >>>
> >>>
> >>>  Dirk
> >>>
> >>>
> >>>
> >>>
> >>>  Monica Ferrero wrote:
> >>>
> >>>> Hi!
> >>>>
> >>>>
> >>>> I'm using Tomcat 4.1.24 with Apache 2 and MySQL 4.0.13. 
> I have the
> >>>> mysql- connector-java-2.0.14-bin.jar in commons/lib.
> >>>> The application runs normally, and usually about once or 
> twice a day
> >>>> I get this exception org.apache.commons.dbcp.DbcpException:
> >>>> java.sql.SQLException: Server configuration denies access to data
> >>>> source. Once the exception occurs, it happens for every 
> request and
> >>>> Tomcat needs restarting.
> >>>>
> >>>> Before getting this exception, I used to run out of 
> connections, and
> >>>> therefore I added to the server.xml
> >>>>
> >>>>         <parameter>
> >>>>           <name>logAbandoned</name>
> >>>>           <value>true</value>
> >>>>         </parameter>
> >>>>         <parameter>
> >>>>           <name>removeAbandoned</name>
> >>>>           <value>true</value>
> >>>>         </parameter>
> >>>>
> >>>> I guess it could be related...
> >>>>
> >>>> I include the exception and my server.xml file.
> >>>>
> >>>> Any help appreciated.
> >>>>
> >>>>
> >>>> Monica
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> 2003-08-07 15:55:02 StandardWrapperValve[StructureServlet]:
> >>>> Servlet.service () for servlet StructureServlet threw exception
> >>>> org.apache.commons.dbcp.DbcpException: 
> java.sql.SQLException: Server
> >>>> configuration denies access to data source
> >>>>         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
> >>>> (GenericObjectPool.java)
> >>>>         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.ah.auk.db.DBUtil.getDBConnection(DBUtil.java:54) at
> >>>>         com.ah.auk.db.DB.checkDBCon(DB.java:34)
> >>>>         at com.ah.auk.db.HotelDBReader.getHotelsInGeoEntry
> >>>> (HotelDBReader.java:64)
> >>>>         at com.ah.auk.delegates.CountyHelper.getHotelsPerCounty
> >>>> (CountyHelper.java:100)
> >>>>         at
> >>>>
> >>>> com.ah.auk.box.CountyListBox.getCounties(CountyListBox.java:118)
> >>>>         at
> >>>>         
> com.ah.auk.box.CountyListBox.configure(CountyListBox.java:63)
> >>>>         at
> >>>>         
> com.ah.auk.core.BoxManager.configureBoxes(BoxManager.java:41)
> >>>>         at com.ah.auk.structure.StructureServlet.doGet
> >>>> (StructureServlet.java:74)
> >>>>         at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java)
> >>>>         at 
> javax.servlet.http.HttpServlet.service(HttpServlet.java)
> >>>>         at
> >>>>
> >>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> >>>> (Unknown Source)
> >>>>         at
> >>>>
> >>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown
> >>>> Source)
> >>>>         at
> >>>>
> >>>> com.ah.auk.context.ContextFilter.doFilter(ContextFilter.java:158)
> >>>>         at
> >>>>
> >>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> >>>> (Unknown Source)
> >>>>         at
> >>>>
> >>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown
> >>>> Source)
> >>>>         at
> >>>>         
> org.apache.catalina.core.StandardWrapperValve.invoke(Unknown
> >>>> Source)
> >>>>         at
> >>>>
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.inv
> >> ok
> >>>> eNext(Unknown Source)
> >>>>         at 
> org.apache.catalina.core.StandardPipeline.invoke(Unknown
> >>>>         Source) at
> >>>>         org.apache.catalina.core.ContainerBase.invoke(Unknown
> >>>>         Source) at
> >>>>         
> org.apache.catalina.core.StandardContextValve.invoke(Unknown
> >>>> Source)
> >>>>         at
> >>>>
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.inv
> >> ok
> >>>> eNext(Unknown Source)
> >>>>         at 
> org.apache.catalina.core.StandardPipeline.invoke(Unknown
> >>>>         Source) at
> >>>>         org.apache.catalina.core.ContainerBase.invoke(Unknown
> >>>>         Source) at
> >>>>         org.apache.catalina.core.StandardContext.invoke(Unknown
> >>>>         Source) at
> >>>>         org.apache.catalina.core.StandardHostValve.invoke(Unknown
> >>>>         Source) at
> >>>>
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.inv
> >> ok
> >>>> eNext(Unknown Source)
> >>>>         at
> >>>>         
> org.apache.catalina.valves.ErrorDispatcherValve.invoke(Unknown
> >>>> Source)
> >>>>         at
> >>>>
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.inv
> >> ok
> >>>> eNext(Unknown Source)
> >>>>         at
> >>>>         
> org.apache.catalina.valves.ErrorReportValve.invoke(Unknown
> >>>> Source)
> >>>>         at
> >>>>
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.inv
> >> ok
> >>>> eNext(Unknown Source)
> >>>>         at 
> org.apache.catalina.core.StandardPipeline.invoke(Unknown
> >>>>         Source) at
> >>>>         org.apache.catalina.core.ContainerBase.invoke(Unknown
> >>>>         Source) at
> >>>>         
> org.apache.catalina.core.StandardEngineValve.invoke(Unknown
> >>>> Source)
> >>>>         at
> >>>>
> org.apache.catalina.core.StandardPipeline$StandardPipelineValv
> eContext.inv
> >> ok
> >>>> eNext(Unknown Source)
> >>>>         at 
> org.apache.catalina.core.StandardPipeline.invoke(Unknown
> >>>>         Source) at
> >>>>         org.apache.catalina.core.ContainerBase.invoke(Unknown
> >>>>         Source) at 
> org.apache.coyote.tomcat4.CoyoteAdapter.service
> >>>> (CoyoteAdapter.java:223)
> >>>>         at org.apache.jk.server.JkCoyoteHandler.invoke
> >>>> (JkCoyoteHandler.java:261)
> >>>>         at org.apache.jk.common.HandlerRequest.invoke
> >>>> (HandlerRequest.java:360)
> >>>>         at
> >>>>
> >>>> org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:604)
> >>>>         at org.apache.jk.common.ChannelSocket.processConnection
> >>>> (ChannelSocket.java:562)
> >>>>         at org.apache.jk.common.SocketConnection.runIt
> >>>> (ChannelSocket.java:679)
> >>>>         at
> >>>>         
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
> >>>> (ThreadPool.java:619)
> >>>>         at java.lang.Thread.run(Thread.java:534)
> >>>> Caused by: java.sql.SQLException: Server configuration 
> denies access
> >>>> to data source
> >>>>         at com.mysql.jdbc.MysqlIO.init(Unknown Source)
> >>>>         at 
> com.mysql.jdbc.Connection.connectionInit(Unknown Source)
> >>>>         at com.mysql.jdbc.jdbc2.Connection.connectionInit(Unknown
> >>>>         Source) at com.mysql.jdbc.Driver.connect(Unknown Source)
> >>>>         at
> >>>>
> >>>> org.apache.commons.dbcp.DriverConnectionFactory.createConnection
> >>>> (DriverConnectionFactory.java:83)
> >>>> ... 49 more
> >>>>
> >>>>
> >>>> SERVER.XML:
> >>>> ----------
> >>>>
> >>>> <Server port="8005" shutdown="SHUTDOWN" debug="0">
> >>>>   <Listener
> >>>>   className="org.apache.catalina.mbeans.ServerLifecycleListener"
> >>>> debug="0"/>
> >>>>   <Listener
> >>>> 
> className="org.apache.catalina.mbeans.GlobalResourcesLifecycle
> Listener"
> >>>> debug="0"/>
> >>>>
> >>>>   <GlobalNamingResources/>
> >>>>
> >>>>   <Service name="Tomcat-Standalone">
> >>>>
> >>>>     <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
> >>>>     <Connector 
> className="org.apache.coyote.tomcat4.CoyoteConnector"
> >>>>                port="8009" minProcessors="5" maxProcessors="75"
> >>>>                enableLookups="true" redirectPort="8443"
> >>>>                acceptCount="10" debug="0" connectionTimeout="0"
> >>>>                useURIValidationHack="false"
> >>>>
> >>>> protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"/>
> >>>>
> >>>>     <Engine name="Standalone" defaultHost="localhost" debug="0">
> >>>>
> >>>>       <Logger className="org.apache.catalina.logger.FileLogger"
> >>>> prefix="catalina_log." suffix=".txt"
> >>>>               timestamp="true"/>
> >>>>
> >>>>       <Host name="localhost" debug="0" appBase="webapps"
> >>>>        unpackWARs="true" autoDeploy="false">
> >>>>          <Logger 
> className="org.apache.catalina.logger.FileLogger"
> >>>>                  directory="logs"  prefix="localhost_log."
> >>>>                  suffix=".txt" timestamp="true"/>
> >>>>           <Context path="" docBase="/home/user/auk" debug="0"
> >>>>                  reloadable="false" crossContext="false">
> >>>>          <Resource name="jdbc/allukmasterDB"
> >>>>                auth="Container"
> >>>>                type="javax.sql.DataSource"/>
> >>>>
> >>>>         <ResourceParams name="jdbc/allukmasterDB">
> >>>>         <parameter>
> >>>>          <name>factory</name>
> >>>>          
> <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
> >>>>         </parameter>
> >>>>         <parameter>
> >>>>          <name>maxActive</name>
> >>>>          <value>500</value>
> >>>>         </parameter>
> >>>>         <parameter>
> >>>>          <name>maxIdle</name>
> >>>>          <value>30</value>
> >>>>         </parameter>
> >>>>         <parameter>
> >>>>          <name>maxWait</name>
> >>>>          <value>10000</value>
> >>>>         </parameter>
> >>>>         <parameter>
> >>>>           <name>username</name>
> >>>>           <value>******</value>
> >>>>         </parameter>
> >>>>         <parameter>
> >>>>          <name>password</name>
> >>>>          <value>*******</value>
> >>>>         </parameter>
> >>>>         <parameter>
> >>>>          <name>driverClassName</name>
> >>>>          <value>org.gjt.mm.mysql.Driver</value>
> >>>>         </parameter>
> >>>>         <parameter>
> >>>>           <name>url</name>
> >>>>           <value>jdbc:mysql://localhost:3306/auk?
> >> autoReconnect=true</value>
> >>>>         </parameter>
> >>>>         <parameter>
> >>>>           <name>logAbandoned</name>
> >>>>           <value>true</value>
> >>>>         </parameter>
> >>>>         <parameter>
> >>>>           <name>removeAbandoned</name>
> >>>>           <value>true</value>
> >>>>         </parameter>
> >>>>         </ResourceParams>
> >>>>       </Context>
> >>>>
> >>>>     </Host>
> >>>>    </Engine>
> >>>>  </Service>
> >>>> </Server>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> 
> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: 
> commons-user-unsubscribe@jakarta.apache.org
> >>>> For additional commands, e-mail:
> >>>> commons-user-help@jakarta.apache.org
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >>>
> >>>
> >>>  
> ---------------------------------------------------------------------
> >>>  To unsubscribe, e-mail: 
> commons-user-unsubscribe@jakarta.apache.org
> >>> For
> >>>  additional commands, e-mail: commons-user-help@jakarta.apache.org
> >>
> >>
> >>
> >>
> >> 
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: 
> commons-user-help@jakarta.apache.org
> > - Brian
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: 
> commons-user-unsubscribe@jakarta.apache.org For
> > additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
 
**************************************************************************
The information transmitted herewith is sensitive information intended only
for use by the individual or entity to which it is addressed. If the reader
of this message is not the intended recipient, you are hereby notified that
any review, retransmission, dissemination, distribution, copying or other
use of, or taking of any action in reliance upon this information is
strictly prohibited. If you have received this communication in error,
please contact the sender and delete the material from your computer.

Mime
View raw message