You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Dirk Verbeeck <di...@pandora.be> on 2003/08/24 21:22:50 UTC

Re: [DBCP]: Tomcat+MySQL. Intermitent DbcpException: Server configuration -> Now pool exhausted

OK, first of all what version of DBCP are you using ? The official build 
or a nightly one?
also the version of commons-pool.

Do you use the "removeAbandonedTimeout" ?
The default value is 300sec. (A connection has to be abandoned for 300 sec)
Are there a lot of requests within the last 300 sec before the DBCP 
exception?

The error messages are written on stderr. Do you have a stderr log?
What is your os? (linux, windows,...)

Dirk

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
>  
>




Re: [DBCP]: Tomcat+MySQL. Intermitent DbcpException: Server configuration

Posted by Dirk Verbeeck <di...@pandora.be>.
You can download it here:
http://cvs.apache.org/~dirkv/builds/dbcp.jsp

Dirk

Monica Ferrero wrote:

>Hello Dirk!
>
>  
>
>>Hi Monica
>>
>>The stacktrace you attached looks like a log4j one. I was looking for
>>the one from the abandoned code.
>>On linux you should look at $CATALINA_BASE/logs/catalina.out
>>    
>>
>
>The catalina.out log looks the same. I'm not getting the logging of the
>abandoned database connections anywhere I can see it...
>
>  
>
>>With only 15 web pages queries the problem should be reproducable on a
>>test system.
>>
>>I have make a build with all the recent changes included, you can
>>download the new jars here:
>>http://cvs.apache.org/~dirkv/builds/
>>Just replace the ones in common/lib
>>
>>I have tested the abandoned funtion using the configuration below and
>>the attached jsp.
>>    
>>
>
>The attached jsp hasn't made it through. I think attached files usually
>don't in themailing list...
>
>  
>
>>The testcase fails for 1.0, don't know why.
>>You will have to use the new version to look for the leak
>>Try the jsp first to see if you get the abandon stacktraces
>>    
>>
>
>Thanks alot. I'll give it a go as soon as I can!
>
>  
>
>>Cheers
>>Dirk
>>    
>>
>
>Monica
>
>  
>
>>==================================================
>>         <Resource name="jdbc/EmployeeAppDb" auth="SERVLET"
>>                   type="javax.sql.DataSource"/>
>>         <ResourceParams name="jdbc/EmployeeAppDb">
>>           <parameter><name>username</name><value>sa</value></parameter>
>>           <parameter><name>password</name><value></value></parameter>
>>           <parameter><name>driverClassName</name>
>>             <value>org.hsqldb.jdbcDriver</value></parameter>
>>           <parameter><name>url</name>
>>             <value>jdbc:hsqldb:database</value></parameter>
>>
>>
>><parameter><name>removeAbandoned</name><value>true</value></parameter>
>>
>><parameter><name>removeAbandonedTimeout</name><value>0</value></parameter>
>>
>><parameter><name>logAbandoned</name><value>true</value></parameter>
>>
>>           <parameter><name>maxActive</name><value>1</value></parameter>
>>
>>         </ResourceParams>
>>    
>>
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
>
>
>  
>




Re: [DBCP]: Tomcat+MySQL. Intermitent DbcpException: Server configuration

Posted by Monica Ferrero <mo...@activehotels.com>.
Hello Dirk!

> Hi Monica
>
> The stacktrace you attached looks like a log4j one. I was looking for
> the one from the abandoned code.
> On linux you should look at $CATALINA_BASE/logs/catalina.out

The catalina.out log looks the same. I'm not getting the logging of the
abandoned database connections anywhere I can see it...

> With only 15 web pages queries the problem should be reproducable on a
> test system.
>
> I have make a build with all the recent changes included, you can
> download the new jars here:
> http://cvs.apache.org/~dirkv/builds/
> Just replace the ones in common/lib
>
> I have tested the abandoned funtion using the configuration below and
> the attached jsp.

The attached jsp hasn't made it through. I think attached files usually
don't in themailing list...

> The testcase fails for 1.0, don't know why.
> You will have to use the new version to look for the leak
> Try the jsp first to see if you get the abandon stacktraces

Thanks alot. I'll give it a go as soon as I can!

> Cheers
> Dirk

Monica

> ==================================================
>          <Resource name="jdbc/EmployeeAppDb" auth="SERVLET"
>                    type="javax.sql.DataSource"/>
>          <ResourceParams name="jdbc/EmployeeAppDb">
>            <parameter><name>username</name><value>sa</value></parameter>
>            <parameter><name>password</name><value></value></parameter>
>            <parameter><name>driverClassName</name>
>              <value>org.hsqldb.jdbcDriver</value></parameter>
>            <parameter><name>url</name>
>              <value>jdbc:hsqldb:database</value></parameter>
>
>
> <parameter><name>removeAbandoned</name><value>true</value></parameter>
>
> <parameter><name>removeAbandonedTimeout</name><value>0</value></parameter>
>
> <parameter><name>logAbandoned</name><value>true</value></parameter>
>
>            <parameter><name>maxActive</name><value>1</value></parameter>
>
>          </ResourceParams>




Re: [DBCP]: Tomcat+MySQL. Intermitent DbcpException: Server configuration

Posted by Dirk Verbeeck <di...@pandora.be>.
Hi Monica

The stacktrace you attached looks like a log4j one. I was looking for 
the one from the abandoned code.
On linux you should look at $CATALINA_BASE/logs/catalina.out

With only 15 web pages queries the problem should be reproducable on a 
test system.

I have make a build with all the recent changes included, you can 
download the new jars here:
http://cvs.apache.org/~dirkv/builds/
Just replace the ones in common/lib

I have tested the abandoned funtion using the configuration below and 
the attached jsp.

The testcase fails for 1.0, don't know why.
You will have to use the new version to look for the leak
Try the jsp first to see if you get the abandon stacktraces

Cheers
Dirk

==================================================
          <Resource name="jdbc/EmployeeAppDb" auth="SERVLET"
                    type="javax.sql.DataSource"/>
          <ResourceParams name="jdbc/EmployeeAppDb">
            <parameter><name>username</name><value>sa</value></parameter>
            <parameter><name>password</name><value></value></parameter>
            <parameter><name>driverClassName</name>
              <value>org.hsqldb.jdbcDriver</value></parameter>
            <parameter><name>url</name>
              <value>jdbc:hsqldb:database</value></parameter>

            
<parameter><name>removeAbandoned</name><value>true</value></parameter>
            
<parameter><name>removeAbandonedTimeout</name><value>0</value></parameter>
            
<parameter><name>logAbandoned</name><value>true</value></parameter>

            <parameter><name>maxActive</name><value>1</value></parameter>

          </ResourceParams>


Re: [DBCP]: Tomcat+MySQL. Intermitent DbcpException: Server configuration

Posted by Monica Ferrero <mo...@activehotels.com>.
Hello!

> OK, first of all what version of DBCP are you using ? The official
> build  or a nightly one?

Official build 1.0

> also the version of commons-pool.

1.0.1

> Do you use the "removeAbandonedTimeout" ?

No, I left it to the default value.

> The default value is 300sec. (A connection has to be abandoned for 300
> sec) Are there a lot of requests within the last 300 sec before the
> DBCP  exception?

I've looked at the logs when the exception happened once, and there was
about 15 web pages queries. At the moment the database it is used quiet
heavily as we haven't implemented a cache yet, so that could go easily over
3000 database queries... Now that I write it down it sounds like an awful
lot...

> The error messages are written on stderr. Do you have a stderr log?

Yes, they are written to the logs. I've included the exception again at the
end of the mail. Is that what you would like to see?

> What is your os? (linux, windows,...)

Linux redhat

> Dirk

Thanks a lot.

Monica


003-08-20 04:04:27,308 ERROR [Thread-13] (DBUtil.java:66) - SQLException
DBCP could not obtain an idle db connection, pool ex
hausted
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.HotelDBReader.getHotelsInGeoEntry
(HotelDBReader.java:64)
        at com.ah.auk.delegates.CountyHelper.getHotelsPerCounty
(CountyHelper.java:100)
        at com.ah.auk.box.CountyListBox.getCounties(CountyListBox.java:124)
        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:88)
        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:177)
        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$StandardPipelineValveContext.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.StandardContextValve.invoke(Unknown
Source)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.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.StandardContext.invoke(Unknown Source)
        at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(Unknown Source)
        at org.apache.catalina.valves.ErrorDispatcherValve.invoke(Unknown
Source)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(Unknown Source)
        at org.apache.catalina.valves.ErrorReportValve.invoke(Unknown
Source)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.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$StandardPipelineValveContext.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)
2003-08-20 04:04:27,310 ERROR [Thread-13] (CountyHelper.java:104) -
Exception DBCP could not obtain an idle db connection, poo
l exhausted
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.HotelDBReader.getHotelsInGeoEntry
(HotelDBReader.java:64)
        at com.ah.auk.delegates.CountyHelper.getHotelsPerCounty
(CountyHelper.java:100)
        at com.ah.auk.box.CountyListBox.getCounties(CountyListBox.java:124)
        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:88)
        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:177)
        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$StandardPipelineValveContext.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.StandardContextValve.invoke(Unknown
Source)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.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.StandardContext.invoke(Unknown Source)
        at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(Unknown Source)
        at org.apache.catalina.valves.ErrorDispatcherValve.invoke(Unknown
Source)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(Unknown Source)
        at org.apache.catalina.valves.ErrorReportValve.invoke(Unknown
Source)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.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$StandardPipelineValveContext.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)
> 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
>>
>>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For
> additional commands, e-mail: commons-user-help@jakarta.apache.org