You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Frank Stolze <fr...@directlyhome.com> on 2003/12/02 17:27:50 UTC

[DBCP] Deadlock problem?

Hi,

I have been having some problems with Tomcat + DBCP for some time now. I
made every effort to find the problem myself and also look through the
mailing list archives, but it seems that I'm at a dead end now. Here is
my problem:

Tomcat 4.1.27
Commons-Pool 1.1
Commons-DBCP 1.1
PostgreSQL 7.3.3

While everything works beautifully for a while, at some (seemingly)
random point in time getting a db connection from the pool fails.
Database connections are available, both idle and not yet established.

Configuration:

          <Resource auth="Container" name="jdbc/Public"
scope="Shareable" type="javax.sql.DataSource"/>
          <ResourceParams name="jdbc/Public">
            <parameter>
              <name>password</name>
              <value>xxxx</value>
            </parameter>
            <parameter>
              <name>url</name>
              <value>jdbc:postgresql://localhost:5432/bfth_db</value>
            </parameter>
            <parameter>
              <name>driverClassName</name>
              <value>org.postgresql.Driver</value>
            </parameter>
            <parameter>
              <name>username</name>
              <value>xxxx</value>
            </parameter>
          </ResourceParams>

Here are two representative thread dumps:

===
Full thread dump Java HotSpot(TM) Server VM (1.4.2-b28 mixed mode):

"MonitorRunnable" daemon prio=1 tid=0x08669ad0 nid=0x722c in
Object.wait() [4f7a2000..4f7a28b8]
	at java.lang.Object.wait(Native Method)
	- waiting on <0x464199f0> (a
org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable)
	at
org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable.run(ThreadPool.java:503)
	- locked <0x464199f0> (a
org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable)
	at java.lang.Thread.run(Thread.java:534)

"Thread-10" daemon prio=1 tid=0x0857f988 nid=0x722b runnable
[4f721000..4f7218b8]
	at java.net.PlainSocketImpl.socketAccept(Native Method)
	at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:353)
	- locked <0x46419a70> (a java.net.PlainSocketImpl)
	at java.net.ServerSocket.implAccept(ServerSocket.java:448)
	at java.net.ServerSocket.accept(ServerSocket.java:419)
	at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:268)
	at
org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:531)
	at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:660)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
	at java.lang.Thread.run(Thread.java:534)

"Thread-9" daemon prio=1 tid=0x087342c0 nid=0x722a in Object.wait()
[4f6a0000..4f6a08b8]
	at java.lang.Object.wait(Native Method)
	- waiting on <0x46419c68> (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
	at java.lang.Object.wait(Object.java:429)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:595)
	- locked <0x46419c68> (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
	at java.lang.Thread.run(Thread.java:534)

"Thread-8" daemon prio=1 tid=0x08734008 nid=0x7229 in Object.wait()
[4f61f000..4f61f8b8]
	at java.lang.Object.wait(Native Method)
	- waiting on <0x46419ce0> (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
	at java.lang.Object.wait(Object.java:429)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:595)
	- locked <0x46419ce0> (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
	at java.lang.Thread.run(Thread.java:534)

"Thread-7" daemon prio=1 tid=0x0857ffe0 nid=0x7228 in Object.wait()
[4f59e000..4f59e8b8]
	at java.lang.Object.wait(Native Method)
	- waiting on <0x46419d58> (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
	at java.lang.Object.wait(Object.java:429)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:595)
	- locked <0x46419d58> (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
	at java.lang.Thread.run(Thread.java:534)

"MonitorRunnable" daemon prio=1 tid=0x4e4f8818 nid=0x7227 in
Object.wait() [4f51d000..4f51d8b8]
	at java.lang.Object.wait(Native Method)
	- waiting on <0x463d6dd8> (a
org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable)
	at
org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable.run(ThreadPool.java:503)
	- locked <0x463d6dd8> (a
org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable)
	at java.lang.Thread.run(Thread.java:534)

"Thread-5" daemon prio=1 tid=0x4e2b60c8 nid=0x7226 in Object.wait()
[4f49b000..4f49c8b8]
	at java.lang.Object.wait(Native Method)
	- waiting on <0x46514830> (a
org.apache.commons.pool.impl.GenericObjectPool)
	at java.lang.Object.wait(Object.java:429)
	at
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:793)
	- locked <0x46514830> (a
org.apache.commons.pool.impl.GenericObjectPool)
	at
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:140)
	at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:518)
	at com.bfth.util.DBBean.getTotalProductCount(Unknown Source)
	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.taglibs.standard.lang.jstl.ArraySuffix.evaluate(ArraySuffix.java:317)
	at
org.apache.taglibs.standard.lang.jstl.ComplexValue.evaluate(ComplexValue.java:146)
	at
org.apache.taglibs.standard.lang.jstl.ELEvaluator.evaluate(ELEvaluator.java:242)
	at
org.apache.taglibs.standard.lang.jstl.ELEvaluator.evaluate(ELEvaluator.java:201)
	at
org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:138)
	at
org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:166)
	at
org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager.evaluate(ExpressionEvaluatorManager.java:112)
	at
org.apache.taglibs.standard.tag.el.core.ExpressionUtil.evalNotNull(ExpressionUtil.java:85)
	at
org.apache.taglibs.standard.tag.el.core.OutTag.evaluateExpressions(OutTag.java:137)
	at
org.apache.taglibs.standard.tag.el.core.OutTag.doStartTag(OutTag.java:95)
	at
org.apache.jsp.products_jsp._jspx_meth_c_out_0(products_jsp.java:336)
	at org.apache.jsp.products_jsp._jspService(products_jsp.java:147)
	at org.apache.jasper.runtime.HttpJspBase.service(Unknown Source)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at org.apache.jasper.servlet.JspServletWrapper.service(Unknown Source)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(Unknown Source)
	at org.apache.jasper.servlet.JspServlet.service(Unknown Source)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	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.invokeNext(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.invokeNext(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.invokeNext(Unknown Source)
	at org.apache.catalina.valves.ErrorDispatcherValve.invoke(Unknown
Source)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
	at org.apache.catalina.valves.ErrorReportValve.invoke(Unknown Source)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(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.invokeNext(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.coyote.http11.Http11Processor.process(Http11Processor.java:601)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
	at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
	at java.lang.Thread.run(Thread.java:534)

"Thread-4" daemon prio=1 tid=0x4e24b3e8 nid=0x7225 runnable
[4f41b000..4f41b8b8]
	at java.net.PlainSocketImpl.socketAccept(Native Method)
	at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:353)
	- locked <0x462d5758> (a java.net.PlainSocketImpl)
	at java.net.ServerSocket.implAccept(ServerSocket.java:448)
	at java.net.ServerSocket.accept(ServerSocket.java:419)
	at
org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:107)
	at
org.apache.tomcat.util.net.PoolTcpEndpoint.acceptSocket(PoolTcpEndpoint.java:356)
	at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:529)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
	at java.lang.Thread.run(Thread.java:534)

"Thread-3" daemon prio=1 tid=0x4e24b288 nid=0x7224 in Object.wait()
[4f399000..4f39a8b8]
	at java.lang.Object.wait(Native Method)
	- waiting on <0x46514830> (a
org.apache.commons.pool.impl.GenericObjectPool)
	at java.lang.Object.wait(Object.java:429)
	at
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:793)
	- locked <0x46514830> (a
org.apache.commons.pool.impl.GenericObjectPool)
	at
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:140)
	at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:518)
	at com.bfth.export.CSVGenerator.prepare(Unknown Source)
	at
com.bfth.export.DataFileGeneratorFactory.getDataFileGenerator(Unknown
Source)
	at com.bfth.export.DataFileGeneratorServlet.doGet(Unknown Source)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	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.invokeNext(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.invokeNext(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.invokeNext(Unknown Source)
	at org.apache.catalina.valves.ErrorDispatcherValve.invoke(Unknown
Source)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
	at org.apache.catalina.valves.ErrorReportValve.invoke(Unknown Source)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(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.invokeNext(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.coyote.http11.Http11Processor.process(Http11Processor.java:601)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
	at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
	at java.lang.Thread.run(Thread.java:534)

"Thread-2" daemon prio=1 tid=0x4e24b068 nid=0x7223 in Object.wait()
[4f319000..4f3198b8]
	at java.lang.Object.wait(Native Method)
	- waiting on <0x463d6ff0> (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
	at java.lang.Object.wait(Object.java:429)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:595)
	- locked <0x463d6ff0> (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
	at java.lang.Thread.run(Thread.java:534)

"HostConfig[localhost]" daemon prio=1 tid=0x4e24ae18 nid=0x7222 waiting
on condition [4f298000..4f2988b8]
	at java.lang.Thread.sleep(Native Method)
	at org.apache.catalina.startup.HostConfig.threadSleep(Unknown Source)
	at org.apache.catalina.startup.HostConfig.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:534)

"StandardManager[/manager]" daemon prio=1 tid=0x4e266450 nid=0x7221
waiting on condition [4f217000..4f2178b8]
	at java.lang.Thread.sleep(Native Method)
	at org.apache.catalina.session.StandardManager.threadSleep(Unknown
Source)
	at org.apache.catalina.session.StandardManager.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:534)

"StandardManager[/prodmgr]" daemon prio=1 tid=0x4e200748 nid=0x7220
waiting on condition [4e3ff000..4e3ff8b8]
	at java.lang.Thread.sleep(Native Method)
	at org.apache.catalina.session.StandardManager.threadSleep(Unknown
Source)
	at org.apache.catalina.session.StandardManager.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:534)

"WebappLoader[/prodmgr]" daemon prio=1 tid=0x4e276518 nid=0x721f waiting
on condition [4f117000..4f1178b8]
	at java.lang.Thread.sleep(Native Method)
	at org.apache.catalina.loader.WebappLoader.threadSleep(Unknown Source)
	at org.apache.catalina.loader.WebappLoader.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:534)

"Signal Dispatcher" daemon prio=1 tid=0x080bc0d8 nid=0x7218 waiting on
condition [0..0]

"Finalizer" daemon prio=1 tid=0x080b7710 nid=0x7216 in Object.wait()
[4107c000..4107c8b8]
	at java.lang.Object.wait(Native Method)
	- waiting on <0x461e83e8> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
	- locked <0x461e83e8> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
	at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

"Reference Handler" daemon prio=1 tid=0x080b7358 nid=0x7215 in
Object.wait() [40ffb000..40ffb8b8]
	at java.lang.Object.wait(Native Method)
	- waiting on <0x461e8450> (a java.lang.ref.Reference$Lock)
	at java.lang.Object.wait(Object.java:429)
	at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:115)
	- locked <0x461e8450> (a java.lang.ref.Reference$Lock)

"main" prio=1 tid=0x08052500 nid=0x7210 runnable [bfffc000..bfffcf78]
	at java.net.PlainSocketImpl.socketAccept(Native Method)
	at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:353)
	- locked <0x46419e40> (a java.net.PlainSocketImpl)
	at java.net.ServerSocket.implAccept(ServerSocket.java:448)
	at java.net.ServerSocket.accept(ServerSocket.java:419)
	at org.apache.catalina.core.StandardServer.await(Unknown Source)
	at org.apache.catalina.startup.Catalina.start(Unknown Source)
	at org.apache.catalina.startup.Catalina.execute(Unknown Source)
	at org.apache.catalina.startup.Catalina.process(Unknown Source)
	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(Unknown Source)

"VM Thread" prio=1 tid=0x080b48e0 nid=0x7214 runnable 

"VM Periodic Task Thread" prio=1 tid=0x080c0420 nid=0x721c waiting on
condition 
"Suspend Checker Thread" prio=1 tid=0x080bb780 nid=0x7217 runnable 
===

And another one:

====
Full thread dump Java HotSpot(TM) Server VM (1.4.2-b28 mixed mode):

"MonitorRunnable" daemon prio=1 tid=0x0809afc0 nid=0x668c in
Object.wait() [4f418000..4f4188b8]
	at java.lang.Object.wait(Native Method)
	- waiting on <0x46417918> (a
org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable)
	at
org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable.run(ThreadPool.java:503)
	- locked <0x46417918> (a
org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable)
	at java.lang.Thread.run(Thread.java:534)

"Thread-10" daemon prio=1 tid=0x08348538 nid=0x668b runnable
[4f397000..4f3978b8]
	at java.net.PlainSocketImpl.socketAccept(Native Method)
	at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:353)
	- locked <0x46417998> (a java.net.PlainSocketImpl)
	at java.net.ServerSocket.implAccept(ServerSocket.java:448)
	at java.net.ServerSocket.accept(ServerSocket.java:419)
	at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:268)
	at
org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:531)
	at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:660)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
	at java.lang.Thread.run(Thread.java:534)

"Thread-9" daemon prio=1 tid=0x083479f0 nid=0x668a in Object.wait()
[4f316000..4f3168b8]
	at java.lang.Object.wait(Native Method)
	- waiting on <0x46417b90> (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
	at java.lang.Object.wait(Object.java:429)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:595)
	- locked <0x46417b90> (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
	at java.lang.Thread.run(Thread.java:534)

"Thread-8" daemon prio=1 tid=0x08347008 nid=0x6689 in Object.wait()
[4f295000..4f2958b8]
	at java.lang.Object.wait(Native Method)
	- waiting on <0x46417c08> (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
	at java.lang.Object.wait(Object.java:429)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:595)
	- locked <0x46417c08> (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
	at java.lang.Thread.run(Thread.java:534)

"Thread-7" daemon prio=1 tid=0x08348958 nid=0x6688 in Object.wait()
[4f214000..4f2148b8]
	at java.lang.Object.wait(Native Method)
	- waiting on <0x46417c80> (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
	at java.lang.Object.wait(Object.java:429)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:595)
	- locked <0x46417c80> (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
	at java.lang.Thread.run(Thread.java:534)

"MonitorRunnable" daemon prio=1 tid=0x08349060 nid=0x6687 in
Object.wait() [4f193000..4f1938b8]
	at java.lang.Object.wait(Native Method)
	- waiting on <0x463d5740> (a
org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable)
	at
org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable.run(ThreadPool.java:503)
	- locked <0x463d5740> (a
org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable)
	at java.lang.Thread.run(Thread.java:534)

"Thread-5" daemon prio=1 tid=0x08345cd8 nid=0x6686 runnable
[4f112000..4f1128b8]
	at java.net.PlainSocketImpl.socketAccept(Native Method)
	at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:353)
	- locked <0x462d5798> (a java.net.PlainSocketImpl)
	at java.net.ServerSocket.implAccept(ServerSocket.java:448)
	at java.net.ServerSocket.accept(ServerSocket.java:419)
	at
org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:107)
	at
org.apache.tomcat.util.net.PoolTcpEndpoint.acceptSocket(PoolTcpEndpoint.java:356)
	at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:529)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
	at java.lang.Thread.run(Thread.java:534)

"Thread-4" daemon prio=1 tid=0x085158b8 nid=0x6685 in Object.wait()
[4f090000..4f0918b8]
	at java.lang.Object.wait(Native Method)
	- waiting on <0x4656cad8> (a
org.apache.commons.pool.impl.GenericObjectPool)
	at java.lang.Object.wait(Object.java:429)
	at
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:793)
	- locked <0x4656cad8> (a
org.apache.commons.pool.impl.GenericObjectPool)
	at
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:140)
	at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:518)
	at com.bfth.util.DBBean.getSiteCategories(Unknown Source)
	at com.bfth.export.CSVGenerator.generate(Unknown Source)
	at com.bfth.export.DataFileGeneratorServlet.doGet(Unknown Source)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	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.invokeNext(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.invokeNext(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.invokeNext(Unknown Source)
	at org.apache.catalina.valves.ErrorDispatcherValve.invoke(Unknown
Source)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
	at org.apache.catalina.valves.ErrorReportValve.invoke(Unknown Source)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(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.invokeNext(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.coyote.http11.Http11Processor.process(Http11Processor.java:601)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
	at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
	at java.lang.Thread.run(Thread.java:534)

"Thread-3" daemon prio=1 tid=0x081c63e0 nid=0x6684 in Object.wait()
[4f00f000..4f0108b8]
	at java.lang.Object.wait(Native Method)
	- waiting on <0x4656cad8> (a
org.apache.commons.pool.impl.GenericObjectPool)
	at java.lang.Object.wait(Object.java:429)
	at
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:793)
	- locked <0x4656cad8> (a
org.apache.commons.pool.impl.GenericObjectPool)
	at
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:140)
	at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:518)
	at com.bfth.util.DBBean.getTotalProductCount(Unknown Source)
	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.taglibs.standard.lang.jstl.ArraySuffix.evaluate(ArraySuffix.java:317)
	at
org.apache.taglibs.standard.lang.jstl.ComplexValue.evaluate(ComplexValue.java:146)
	at
org.apache.taglibs.standard.lang.jstl.ELEvaluator.evaluate(ELEvaluator.java:242)
	at
org.apache.taglibs.standard.lang.jstl.ELEvaluator.evaluate(ELEvaluator.java:201)
	at
org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:138)
	at
org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:166)
	at
org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager.evaluate(ExpressionEvaluatorManager.java:112)
	at
org.apache.taglibs.standard.tag.el.core.ExpressionUtil.evalNotNull(ExpressionUtil.java:85)
	at
org.apache.taglibs.standard.tag.el.core.OutTag.evaluateExpressions(OutTag.java:137)
	at
org.apache.taglibs.standard.tag.el.core.OutTag.doStartTag(OutTag.java:95)
	at
org.apache.jsp.products_jsp._jspx_meth_c_out_0(products_jsp.java:336)
	at org.apache.jsp.products_jsp._jspService(products_jsp.java:147)
	at org.apache.jasper.runtime.HttpJspBase.service(Unknown Source)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at org.apache.jasper.servlet.JspServletWrapper.service(Unknown Source)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(Unknown Source)
	at org.apache.jasper.servlet.JspServlet.service(Unknown Source)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	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.invokeNext(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.invokeNext(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.invokeNext(Unknown Source)
	at org.apache.catalina.valves.ErrorDispatcherValve.invoke(Unknown
Source)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown Source)
	at org.apache.catalina.valves.ErrorReportValve.invoke(Unknown Source)
	at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(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.invokeNext(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.coyote.http11.Http11Processor.process(Http11Processor.java:601)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
	at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
	at java.lang.Thread.run(Thread.java:534)

"Thread-2" daemon prio=1 tid=0x081c5df8 nid=0x6683 in Object.wait()
[4ef8f000..4ef8f8b8]
	at java.lang.Object.wait(Native Method)
	- waiting on <0x463d5958> (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
	at java.lang.Object.wait(Object.java:429)
	at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:595)
	- locked <0x463d5958> (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
	at java.lang.Thread.run(Thread.java:534)

"HostConfig[localhost]" daemon prio=1 tid=0x08343658 nid=0x6682 waiting
on condition [4ef0e000..4ef0e8b8]
	at java.lang.Thread.sleep(Native Method)
	at org.apache.catalina.startup.HostConfig.threadSleep(Unknown Source)
	at org.apache.catalina.startup.HostConfig.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:534)

"StandardManager[/manager]" daemon prio=1 tid=0x083433e0 nid=0x6681
waiting on condition [4ee8d000..4ee8d8b8]
	at java.lang.Thread.sleep(Native Method)
	at org.apache.catalina.session.StandardManager.threadSleep(Unknown
Source)
	at org.apache.catalina.session.StandardManager.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:534)

"StandardManager[/prodmgr]" daemon prio=1 tid=0x08091f98 nid=0x6680
waiting on condition [4ee0c000..4ee0c8b8]
	at java.lang.Thread.sleep(Native Method)
	at org.apache.catalina.session.StandardManager.threadSleep(Unknown
Source)
	at org.apache.catalina.session.StandardManager.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:534)

"WebappLoader[/prodmgr]" daemon prio=1 tid=0x4e70ddd0 nid=0x667f waiting
on condition [4ed0c000..4ed0c8b8]
	at java.lang.Thread.sleep(Native Method)
	at org.apache.catalina.loader.WebappLoader.threadSleep(Unknown Source)
	at org.apache.catalina.loader.WebappLoader.run(Unknown Source)
	at java.lang.Thread.run(Thread.java:534)

"Signal Dispatcher" daemon prio=1 tid=0x080bc0d0 nid=0x664f waiting on
condition [0..0]

"Finalizer" daemon prio=1 tid=0x080b7710 nid=0x664d in Object.wait()
[4107c000..4107c8b8]
	at java.lang.Object.wait(Native Method)
	- waiting on <0x461e83e8> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
	- locked <0x461e83e8> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
	at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

"Reference Handler" daemon prio=1 tid=0x080b7358 nid=0x664c in
Object.wait() [40ffb000..40ffb8b8]
	at java.lang.Object.wait(Native Method)
	- waiting on <0x461e8450> (a java.lang.ref.Reference$Lock)
	at java.lang.Object.wait(Object.java:429)
	at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:115)
	- locked <0x461e8450> (a java.lang.ref.Reference$Lock)

"main" prio=1 tid=0x08052500 nid=0x6641 runnable [bfffd000..bfffd8d8]
	at java.net.PlainSocketImpl.socketAccept(Native Method)
	at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:353)
	- locked <0x46417cb0> (a java.net.PlainSocketImpl)
	at java.net.ServerSocket.implAccept(ServerSocket.java:448)
	at java.net.ServerSocket.accept(ServerSocket.java:419)
	at org.apache.catalina.core.StandardServer.await(Unknown Source)
	at org.apache.catalina.startup.Catalina.start(Unknown Source)
	at org.apache.catalina.startup.Catalina.execute(Unknown Source)
	at org.apache.catalina.startup.Catalina.process(Unknown Source)
	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(Unknown Source)

"VM Thread" prio=1 tid=0x080b48e0 nid=0x664b runnable 

"VM Periodic Task Thread" prio=1 tid=0x080c0418 nid=0x6653 waiting on
condition 
"Suspend Checker Thread" prio=1 tid=0x080bb778 nid=0x664e runnable 
===

Any advice would be appreciated!


Frank


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [DBCP] Deadlock problem?

Posted by John Zoetebier <jo...@transparent.co.nz>.
The trick in tackling this problem is to isolate the root cause.
This could be in any of the components: DBCP, Postgresql, Tomcat, or an 
interaction between them.
One suggestion is to make an emulation program.

The program should emulate as close as possible:
- the number of online users which give you MaxActive
- number of idle connections.
- avarage number of connections before failure

To speed up testing built in a wait of for example 1 second between 
borrowing a connection and closing a connection.
Built in a randomizer to varry the number of connections to open and close.
By logging the connections you can track of there is a particular pattern 
which leads up to the problem point.
To isolate the problem further, remove one of the components, for example 
replace Postgresql by McKoi and see if the problem can be replicated.
If it can be replicated you know the problem is probably not in Postgreslq 
or an interaction problem with Postgresql.
Repeat this process until you know where the problem sits and then drill 
down in that component.

-- 
John Zoetebier
Web site: http://www.transparent.co.nz


On Tue, 02 Dec 2003 11:27:50 -0500, Frank Stolze <fr...@directlyhome.com> 
wrote:

> Hi,
>
> I have been having some problems with Tomcat + DBCP for some time now. I
> made every effort to find the problem myself and also look through the
> mailing list archives, but it seems that I'm at a dead end now. Here is
> my problem:
>
> Tomcat 4.1.27
> Commons-Pool 1.1
> Commons-DBCP 1.1
> PostgreSQL 7.3.3
>
> While everything works beautifully for a while, at some (seemingly)
> random point in time getting a db connection from the pool fails.
> Database connections are available, both idle and not yet established.
>
> Configuration:
>
>           <Resource auth="Container" name="jdbc/Public"
> scope="Shareable" type="javax.sql.DataSource"/>
>           <ResourceParams name="jdbc/Public">
>             <parameter>
>               <name>password</name>
>               <value>xxxx</value>
>             </parameter>
>             <parameter>
>               <name>url</name>
>               <value>jdbc:postgresql://localhost:5432/bfth_db</value>
>             </parameter>
>             <parameter>
>               <name>driverClassName</name>
>               <value>org.postgresql.Driver</value>
>             </parameter>
>             <parameter>
>               <name>username</name>
>               <value>xxxx</value>
>             </parameter>
>           </ResourceParams>
>
> Here are two representative thread dumps:
>
> ===
> Full thread dump Java HotSpot(TM) Server VM (1.4.2-b28 mixed mode):
>
> "MonitorRunnable" daemon prio=1 tid=0x08669ad0 nid=0x722c in
> Object.wait() [4f7a2000..4f7a28b8]
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on <0x464199f0> (a
> org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable)
> 	at
> org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable.run(ThreadPool.java:503)
> 	- locked <0x464199f0> (a
> org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable)
> 	at java.lang.Thread.run(Thread.java:534)
>
> "Thread-10" daemon prio=1 tid=0x0857f988 nid=0x722b runnable
> [4f721000..4f7218b8]
> 	at java.net.PlainSocketImpl.socketAccept(Native Method)
> 	at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:353)
> 	- locked <0x46419a70> (a java.net.PlainSocketImpl)
> 	at java.net.ServerSocket.implAccept(ServerSocket.java:448)
> 	at java.net.ServerSocket.accept(ServerSocket.java:419)
> 	at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:268)
> 	at
> org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:531)
> 	at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:660)
> 	at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
> 	at java.lang.Thread.run(Thread.java:534)
>
> "Thread-9" daemon prio=1 tid=0x087342c0 nid=0x722a in Object.wait()
> [4f6a0000..4f6a08b8]
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on <0x46419c68> (a
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
> 	at java.lang.Object.wait(Object.java:429)
> 	at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:595)
> 	- locked <0x46419c68> (a
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
> 	at java.lang.Thread.run(Thread.java:534)
>
> "Thread-8" daemon prio=1 tid=0x08734008 nid=0x7229 in Object.wait()
> [4f61f000..4f61f8b8]
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on <0x46419ce0> (a
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
> 	at java.lang.Object.wait(Object.java:429)
> 	at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:595)
> 	- locked <0x46419ce0> (a
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
> 	at java.lang.Thread.run(Thread.java:534)
>
> "Thread-7" daemon prio=1 tid=0x0857ffe0 nid=0x7228 in Object.wait()
> [4f59e000..4f59e8b8]
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on <0x46419d58> (a
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
> 	at java.lang.Object.wait(Object.java:429)
> 	at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:595)
> 	- locked <0x46419d58> (a
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
> 	at java.lang.Thread.run(Thread.java:534)
>
> "MonitorRunnable" daemon prio=1 tid=0x4e4f8818 nid=0x7227 in
> Object.wait() [4f51d000..4f51d8b8]
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on <0x463d6dd8> (a
> org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable)
> 	at
> org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable.run(ThreadPool.java:503)
> 	- locked <0x463d6dd8> (a
> org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable)
> 	at java.lang.Thread.run(Thread.java:534)
>
> "Thread-5" daemon prio=1 tid=0x4e2b60c8 nid=0x7226 in Object.wait()
> [4f49b000..4f49c8b8]
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on <0x46514830> (a
> org.apache.commons.pool.impl.GenericObjectPool)
> 	at java.lang.Object.wait(Object.java:429)
> 	at
> org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:793)
> 	- locked <0x46514830> (a
> org.apache.commons.pool.impl.GenericObjectPool)
> 	at
> org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:140)
> 	at
> org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:518)
> 	at com.bfth.util.DBBean.getTotalProductCount(Unknown Source)
> 	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.taglibs.standard.lang.jstl.ArraySuffix.evaluate(ArraySuffix.java:317)
> 	at
> org.apache.taglibs.standard.lang.jstl.ComplexValue.evaluate(ComplexValue.java:146)
> 	at
> org.apache.taglibs.standard.lang.jstl.ELEvaluator.evaluate(ELEvaluator.java:242)
> 	at
> org.apache.taglibs.standard.lang.jstl.ELEvaluator.evaluate(ELEvaluator.java:201)
> 	at
> org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:138)
> 	at
> org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:166)
> 	at
> org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager.evaluate(ExpressionEvaluatorManager.java:112)
> 	at
> org.apache.taglibs.standard.tag.el.core.ExpressionUtil.evalNotNull(ExpressionUtil.java:85)
> 	at
> org.apache.taglibs.standard.tag.el.core.OutTag.evaluateExpressions(OutTag.java:137)
> 	at
> org.apache.taglibs.standard.tag.el.core.OutTag.doStartTag(OutTag.java:95)
> 	at
> org.apache.jsp.products_jsp._jspx_meth_c_out_0(products_jsp.java:336)
> 	at org.apache.jsp.products_jsp._jspService(products_jsp.java:147)
> 	at org.apache.jasper.runtime.HttpJspBase.service(Unknown Source)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 	at org.apache.jasper.servlet.JspServletWrapper.service(Unknown Source)
> 	at org.apache.jasper.servlet.JspServlet.serviceJspFile(Unknown Source)
> 	at org.apache.jasper.servlet.JspServlet.service(Unknown Source)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 	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.invokeNext(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.invokeNext(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.invokeNext(Unknown 
> Source)
> 	at org.apache.catalina.valves.ErrorDispatcherValve.invoke(Unknown
> Source)
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown 
> Source)
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(Unknown Source)
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(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.invokeNext(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.coyote.http11.Http11Processor.process(Http11Processor.java:601)
> 	at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
> 	at
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
> 	at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
> 	at java.lang.Thread.run(Thread.java:534)
>
> "Thread-4" daemon prio=1 tid=0x4e24b3e8 nid=0x7225 runnable
> [4f41b000..4f41b8b8]
> 	at java.net.PlainSocketImpl.socketAccept(Native Method)
> 	at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:353)
> 	- locked <0x462d5758> (a java.net.PlainSocketImpl)
> 	at java.net.ServerSocket.implAccept(ServerSocket.java:448)
> 	at java.net.ServerSocket.accept(ServerSocket.java:419)
> 	at
> org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:107)
> 	at
> org.apache.tomcat.util.net.PoolTcpEndpoint.acceptSocket(PoolTcpEndpoint.java:356)
> 	at
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:529)
> 	at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
> 	at java.lang.Thread.run(Thread.java:534)
>
> "Thread-3" daemon prio=1 tid=0x4e24b288 nid=0x7224 in Object.wait()
> [4f399000..4f39a8b8]
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on <0x46514830> (a
> org.apache.commons.pool.impl.GenericObjectPool)
> 	at java.lang.Object.wait(Object.java:429)
> 	at
> org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:793)
> 	- locked <0x46514830> (a
> org.apache.commons.pool.impl.GenericObjectPool)
> 	at
> org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:140)
> 	at
> org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:518)
> 	at com.bfth.export.CSVGenerator.prepare(Unknown Source)
> 	at
> com.bfth.export.DataFileGeneratorFactory.getDataFileGenerator(Unknown
> Source)
> 	at com.bfth.export.DataFileGeneratorServlet.doGet(Unknown Source)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 	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.invokeNext(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.invokeNext(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.invokeNext(Unknown 
> Source)
> 	at org.apache.catalina.valves.ErrorDispatcherValve.invoke(Unknown
> Source)
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown 
> Source)
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(Unknown Source)
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(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.invokeNext(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.coyote.http11.Http11Processor.process(Http11Processor.java:601)
> 	at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
> 	at
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
> 	at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
> 	at java.lang.Thread.run(Thread.java:534)
>
> "Thread-2" daemon prio=1 tid=0x4e24b068 nid=0x7223 in Object.wait()
> [4f319000..4f3198b8]
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on <0x463d6ff0> (a
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
> 	at java.lang.Object.wait(Object.java:429)
> 	at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:595)
> 	- locked <0x463d6ff0> (a
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
> 	at java.lang.Thread.run(Thread.java:534)
>
> "HostConfig[localhost]" daemon prio=1 tid=0x4e24ae18 nid=0x7222 waiting
> on condition [4f298000..4f2988b8]
> 	at java.lang.Thread.sleep(Native Method)
> 	at org.apache.catalina.startup.HostConfig.threadSleep(Unknown Source)
> 	at org.apache.catalina.startup.HostConfig.run(Unknown Source)
> 	at java.lang.Thread.run(Thread.java:534)
>
> "StandardManager[/manager]" daemon prio=1 tid=0x4e266450 nid=0x7221
> waiting on condition [4f217000..4f2178b8]
> 	at java.lang.Thread.sleep(Native Method)
> 	at org.apache.catalina.session.StandardManager.threadSleep(Unknown
> Source)
> 	at org.apache.catalina.session.StandardManager.run(Unknown Source)
> 	at java.lang.Thread.run(Thread.java:534)
>
> "StandardManager[/prodmgr]" daemon prio=1 tid=0x4e200748 nid=0x7220
> waiting on condition [4e3ff000..4e3ff8b8]
> 	at java.lang.Thread.sleep(Native Method)
> 	at org.apache.catalina.session.StandardManager.threadSleep(Unknown
> Source)
> 	at org.apache.catalina.session.StandardManager.run(Unknown Source)
> 	at java.lang.Thread.run(Thread.java:534)
>
> "WebappLoader[/prodmgr]" daemon prio=1 tid=0x4e276518 nid=0x721f waiting
> on condition [4f117000..4f1178b8]
> 	at java.lang.Thread.sleep(Native Method)
> 	at org.apache.catalina.loader.WebappLoader.threadSleep(Unknown Source)
> 	at org.apache.catalina.loader.WebappLoader.run(Unknown Source)
> 	at java.lang.Thread.run(Thread.java:534)
>
> "Signal Dispatcher" daemon prio=1 tid=0x080bc0d8 nid=0x7218 waiting on
> condition [0..0]
>
> "Finalizer" daemon prio=1 tid=0x080b7710 nid=0x7216 in Object.wait()
> [4107c000..4107c8b8]
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on <0x461e83e8> (a java.lang.ref.ReferenceQueue$Lock)
> 	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
> 	- locked <0x461e83e8> (a java.lang.ref.ReferenceQueue$Lock)
> 	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
> 	at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
>
> "Reference Handler" daemon prio=1 tid=0x080b7358 nid=0x7215 in
> Object.wait() [40ffb000..40ffb8b8]
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on <0x461e8450> (a java.lang.ref.Reference$Lock)
> 	at java.lang.Object.wait(Object.java:429)
> 	at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:115)
> 	- locked <0x461e8450> (a java.lang.ref.Reference$Lock)
>
> "main" prio=1 tid=0x08052500 nid=0x7210 runnable [bfffc000..bfffcf78]
> 	at java.net.PlainSocketImpl.socketAccept(Native Method)
> 	at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:353)
> 	- locked <0x46419e40> (a java.net.PlainSocketImpl)
> 	at java.net.ServerSocket.implAccept(ServerSocket.java:448)
> 	at java.net.ServerSocket.accept(ServerSocket.java:419)
> 	at org.apache.catalina.core.StandardServer.await(Unknown Source)
> 	at org.apache.catalina.startup.Catalina.start(Unknown Source)
> 	at org.apache.catalina.startup.Catalina.execute(Unknown Source)
> 	at org.apache.catalina.startup.Catalina.process(Unknown Source)
> 	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(Unknown Source)
>
> "VM Thread" prio=1 tid=0x080b48e0 nid=0x7214 runnable
>
> "VM Periodic Task Thread" prio=1 tid=0x080c0420 nid=0x721c waiting on
> condition
> "Suspend Checker Thread" prio=1 tid=0x080bb780 nid=0x7217 runnable
> ===
>
> And another one:
>
> ====
> Full thread dump Java HotSpot(TM) Server VM (1.4.2-b28 mixed mode):
>
> "MonitorRunnable" daemon prio=1 tid=0x0809afc0 nid=0x668c in
> Object.wait() [4f418000..4f4188b8]
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on <0x46417918> (a
> org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable)
> 	at
> org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable.run(ThreadPool.java:503)
> 	- locked <0x46417918> (a
> org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable)
> 	at java.lang.Thread.run(Thread.java:534)
>
> "Thread-10" daemon prio=1 tid=0x08348538 nid=0x668b runnable
> [4f397000..4f3978b8]
> 	at java.net.PlainSocketImpl.socketAccept(Native Method)
> 	at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:353)
> 	- locked <0x46417998> (a java.net.PlainSocketImpl)
> 	at java.net.ServerSocket.implAccept(ServerSocket.java:448)
> 	at java.net.ServerSocket.accept(ServerSocket.java:419)
> 	at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:268)
> 	at
> org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:531)
> 	at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:660)
> 	at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
> 	at java.lang.Thread.run(Thread.java:534)
>
> "Thread-9" daemon prio=1 tid=0x083479f0 nid=0x668a in Object.wait()
> [4f316000..4f3168b8]
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on <0x46417b90> (a
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
> 	at java.lang.Object.wait(Object.java:429)
> 	at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:595)
> 	- locked <0x46417b90> (a
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
> 	at java.lang.Thread.run(Thread.java:534)
>
> "Thread-8" daemon prio=1 tid=0x08347008 nid=0x6689 in Object.wait()
> [4f295000..4f2958b8]
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on <0x46417c08> (a
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
> 	at java.lang.Object.wait(Object.java:429)
> 	at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:595)
> 	- locked <0x46417c08> (a
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
> 	at java.lang.Thread.run(Thread.java:534)
>
> "Thread-7" daemon prio=1 tid=0x08348958 nid=0x6688 in Object.wait()
> [4f214000..4f2148b8]
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on <0x46417c80> (a
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
> 	at java.lang.Object.wait(Object.java:429)
> 	at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:595)
> 	- locked <0x46417c80> (a
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
> 	at java.lang.Thread.run(Thread.java:534)
>
> "MonitorRunnable" daemon prio=1 tid=0x08349060 nid=0x6687 in
> Object.wait() [4f193000..4f1938b8]
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on <0x463d5740> (a
> org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable)
> 	at
> org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable.run(ThreadPool.java:503)
> 	- locked <0x463d5740> (a
> org.apache.tomcat.util.threads.ThreadPool$MonitorRunnable)
> 	at java.lang.Thread.run(Thread.java:534)
>
> "Thread-5" daemon prio=1 tid=0x08345cd8 nid=0x6686 runnable
> [4f112000..4f1128b8]
> 	at java.net.PlainSocketImpl.socketAccept(Native Method)
> 	at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:353)
> 	- locked <0x462d5798> (a java.net.PlainSocketImpl)
> 	at java.net.ServerSocket.implAccept(ServerSocket.java:448)
> 	at java.net.ServerSocket.accept(ServerSocket.java:419)
> 	at
> org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:107)
> 	at
> org.apache.tomcat.util.net.PoolTcpEndpoint.acceptSocket(PoolTcpEndpoint.java:356)
> 	at
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:529)
> 	at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
> 	at java.lang.Thread.run(Thread.java:534)
>
> "Thread-4" daemon prio=1 tid=0x085158b8 nid=0x6685 in Object.wait()
> [4f090000..4f0918b8]
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on <0x4656cad8> (a
> org.apache.commons.pool.impl.GenericObjectPool)
> 	at java.lang.Object.wait(Object.java:429)
> 	at
> org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:793)
> 	- locked <0x4656cad8> (a
> org.apache.commons.pool.impl.GenericObjectPool)
> 	at
> org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:140)
> 	at
> org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:518)
> 	at com.bfth.util.DBBean.getSiteCategories(Unknown Source)
> 	at com.bfth.export.CSVGenerator.generate(Unknown Source)
> 	at com.bfth.export.DataFileGeneratorServlet.doGet(Unknown Source)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 	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.invokeNext(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.invokeNext(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.invokeNext(Unknown 
> Source)
> 	at org.apache.catalina.valves.ErrorDispatcherValve.invoke(Unknown
> Source)
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown 
> Source)
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(Unknown Source)
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(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.invokeNext(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.coyote.http11.Http11Processor.process(Http11Processor.java:601)
> 	at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
> 	at
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
> 	at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
> 	at java.lang.Thread.run(Thread.java:534)
>
> "Thread-3" daemon prio=1 tid=0x081c63e0 nid=0x6684 in Object.wait()
> [4f00f000..4f0108b8]
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on <0x4656cad8> (a
> org.apache.commons.pool.impl.GenericObjectPool)
> 	at java.lang.Object.wait(Object.java:429)
> 	at
> org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:793)
> 	- locked <0x4656cad8> (a
> org.apache.commons.pool.impl.GenericObjectPool)
> 	at
> org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:140)
> 	at
> org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:518)
> 	at com.bfth.util.DBBean.getTotalProductCount(Unknown Source)
> 	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.taglibs.standard.lang.jstl.ArraySuffix.evaluate(ArraySuffix.java:317)
> 	at
> org.apache.taglibs.standard.lang.jstl.ComplexValue.evaluate(ComplexValue.java:146)
> 	at
> org.apache.taglibs.standard.lang.jstl.ELEvaluator.evaluate(ELEvaluator.java:242)
> 	at
> org.apache.taglibs.standard.lang.jstl.ELEvaluator.evaluate(ELEvaluator.java:201)
> 	at
> org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:138)
> 	at
> org.apache.taglibs.standard.lang.jstl.Evaluator.evaluate(Evaluator.java:166)
> 	at
> org.apache.taglibs.standard.lang.support.ExpressionEvaluatorManager.evaluate(ExpressionEvaluatorManager.java:112)
> 	at
> org.apache.taglibs.standard.tag.el.core.ExpressionUtil.evalNotNull(ExpressionUtil.java:85)
> 	at
> org.apache.taglibs.standard.tag.el.core.OutTag.evaluateExpressions(OutTag.java:137)
> 	at
> org.apache.taglibs.standard.tag.el.core.OutTag.doStartTag(OutTag.java:95)
> 	at
> org.apache.jsp.products_jsp._jspx_meth_c_out_0(products_jsp.java:336)
> 	at org.apache.jsp.products_jsp._jspService(products_jsp.java:147)
> 	at org.apache.jasper.runtime.HttpJspBase.service(Unknown Source)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 	at org.apache.jasper.servlet.JspServletWrapper.service(Unknown Source)
> 	at org.apache.jasper.servlet.JspServlet.serviceJspFile(Unknown Source)
> 	at org.apache.jasper.servlet.JspServlet.service(Unknown Source)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 	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.invokeNext(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.invokeNext(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.invokeNext(Unknown 
> Source)
> 	at org.apache.catalina.valves.ErrorDispatcherValve.invoke(Unknown
> Source)
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown 
> Source)
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(Unknown Source)
> 	at
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(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.invokeNext(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.coyote.http11.Http11Processor.process(Http11Processor.java:601)
> 	at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
> 	at
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
> 	at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
> 	at java.lang.Thread.run(Thread.java:534)
>
> "Thread-2" daemon prio=1 tid=0x081c5df8 nid=0x6683 in Object.wait()
> [4ef8f000..4ef8f8b8]
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on <0x463d5958> (a
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
> 	at java.lang.Object.wait(Object.java:429)
> 	at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:595)
> 	- locked <0x463d5958> (a
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
> 	at java.lang.Thread.run(Thread.java:534)
>
> "HostConfig[localhost]" daemon prio=1 tid=0x08343658 nid=0x6682 waiting
> on condition [4ef0e000..4ef0e8b8]
> 	at java.lang.Thread.sleep(Native Method)
> 	at org.apache.catalina.startup.HostConfig.threadSleep(Unknown Source)
> 	at org.apache.catalina.startup.HostConfig.run(Unknown Source)
> 	at java.lang.Thread.run(Thread.java:534)
>
> "StandardManager[/manager]" daemon prio=1 tid=0x083433e0 nid=0x6681
> waiting on condition [4ee8d000..4ee8d8b8]
> 	at java.lang.Thread.sleep(Native Method)
> 	at org.apache.catalina.session.StandardManager.threadSleep(Unknown
> Source)
> 	at org.apache.catalina.session.StandardManager.run(Unknown Source)
> 	at java.lang.Thread.run(Thread.java:534)
>
> "StandardManager[/prodmgr]" daemon prio=1 tid=0x08091f98 nid=0x6680
> waiting on condition [4ee0c000..4ee0c8b8]
> 	at java.lang.Thread.sleep(Native Method)
> 	at org.apache.catalina.session.StandardManager.threadSleep(Unknown
> Source)
> 	at org.apache.catalina.session.StandardManager.run(Unknown Source)
> 	at java.lang.Thread.run(Thread.java:534)
>
> "WebappLoader[/prodmgr]" daemon prio=1 tid=0x4e70ddd0 nid=0x667f waiting
> on condition [4ed0c000..4ed0c8b8]
> 	at java.lang.Thread.sleep(Native Method)
> 	at org.apache.catalina.loader.WebappLoader.threadSleep(Unknown Source)
> 	at org.apache.catalina.loader.WebappLoader.run(Unknown Source)
> 	at java.lang.Thread.run(Thread.java:534)
>
> "Signal Dispatcher" daemon prio=1 tid=0x080bc0d0 nid=0x664f waiting on
> condition [0..0]
>
> "Finalizer" daemon prio=1 tid=0x080b7710 nid=0x664d in Object.wait()
> [4107c000..4107c8b8]
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on <0x461e83e8> (a java.lang.ref.ReferenceQueue$Lock)
> 	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
> 	- locked <0x461e83e8> (a java.lang.ref.ReferenceQueue$Lock)
> 	at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
> 	at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
>
> "Reference Handler" daemon prio=1 tid=0x080b7358 nid=0x664c in
> Object.wait() [40ffb000..40ffb8b8]
> 	at java.lang.Object.wait(Native Method)
> 	- waiting on <0x461e8450> (a java.lang.ref.Reference$Lock)
> 	at java.lang.Object.wait(Object.java:429)
> 	at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:115)
> 	- locked <0x461e8450> (a java.lang.ref.Reference$Lock)
>
> "main" prio=1 tid=0x08052500 nid=0x6641 runnable [bfffd000..bfffd8d8]
> 	at java.net.PlainSocketImpl.socketAccept(Native Method)
> 	at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:353)
> 	- locked <0x46417cb0> (a java.net.PlainSocketImpl)
> 	at java.net.ServerSocket.implAccept(ServerSocket.java:448)
> 	at java.net.ServerSocket.accept(ServerSocket.java:419)
> 	at org.apache.catalina.core.StandardServer.await(Unknown Source)
> 	at org.apache.catalina.startup.Catalina.start(Unknown Source)
> 	at org.apache.catalina.startup.Catalina.execute(Unknown Source)
> 	at org.apache.catalina.startup.Catalina.process(Unknown Source)
> 	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(Unknown Source)
>
> "VM Thread" prio=1 tid=0x080b48e0 nid=0x664b runnable
>
> "VM Periodic Task Thread" prio=1 tid=0x080c0418 nid=0x6653 waiting on
> condition
> "Suspend Checker Thread" prio=1 tid=0x080bb778 nid=0x664e runnable
> ===
>
> Any advice would be appreciated!
>
>
> Frank
>
>
> ---------------------------------------------------------------------
> 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


Re: [DBCP] Deadlock problem?

Posted by Dirk Verbeeck <di...@pandora.be>.
8 connections is the default maxActive

You can also use the following page to get the number of active/idle 
connections from the perspective of the database pool:
http://cvs.apache.org/~dirkv/builds/showJNDI.jsp

-- Dirk

Frank Stolze wrote:
> Dirk,
> 
> Thank you for your follow-up. I did restart the server between those
> thread dumps. They represent the server being in a "hung" state, at
> different instances.
> 
> In terms of database connections, at that point in time I usually see 4
> to 6 connections, all of them in an idle state. The database server
> allows 128 connections, and DBCP was at the default setting (8 I
> believe?).
> 
> I will generate several dumps when I catch another event like this.
> 
> Regards,
> Frank
> 
> 
> On Tue, 2003-12-02 at 18:07, Dirk Verbeeck wrote:
> 
>>Actually I don't see a deadlock in the stack traces you provided.
>>I see two times 2 threads waiting for a connection
>>
>>In the first dump a getConnection from a <c:out> in your products.jsp page and 
>>from CSVGenerator called in DataFileGeneratorServlet.
>>
>>The second dump again in the CSVGenerator but a different place and also the 
>>products.jsp page.
>>
>>You probably did restart the server between the two threaddumps?
>>Please make a couple of threaddumps with 30 sec inbetween without restarting.
>>
>>How did you test the number of available database connections?
>>
>>-- Dirk
>>
>>Frank Stolze wrote:
>>
>>
>>>Hi,
>>>
>>>I have been having some problems with Tomcat + DBCP for some time now. I
>>>made every effort to find the problem myself and also look through the
>>>mailing list archives, but it seems that I'm at a dead end now. Here is
>>>my problem:
>>>
>>>Tomcat 4.1.27
>>>Commons-Pool 1.1
>>>Commons-DBCP 1.1
>>>PostgreSQL 7.3.3
>>>
>>>While everything works beautifully for a while, at some (seemingly)
>>>random point in time getting a db connection from the pool fails.
>>>Database connections are available, both idle and not yet established.
>>>
>>>Configuration:
>>>
>>>          <Resource auth="Container" name="jdbc/Public"
>>>scope="Shareable" type="javax.sql.DataSource"/>
>>>          <ResourceParams name="jdbc/Public">
>>>            <parameter>
>>>              <name>password</name>
>>>              <value>xxxx</value>
>>>            </parameter>
>>>            <parameter>
>>>              <name>url</name>
>>>              <value>jdbc:postgresql://localhost:5432/bfth_db</value>
>>>            </parameter>
>>>            <parameter>
>>>              <name>driverClassName</name>
>>>              <value>org.postgresql.Driver</value>
>>>            </parameter>
>>>            <parameter>
>>>              <name>username</name>
>>>              <value>xxxx</value>
>>>            </parameter>
>>>          </ResourceParams>
>>>
>>>Here are two representative thread dumps:
>>
>>threaddumps removed
>>
>>
>>>Any advice would be appreciated!
>>>
>>>
>>>Frank
>>
>>
>>
>>
>>---------------------------------------------------------------------
>>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


Re: DBCP oracle connections less than minActive ?

Posted by John Zoetebier <jo...@transparent.co.nz>.
On Wed, 03 Dec 2003 12:40:32 -0500, Arun Natarajan <an...@gmu.edu> 
wrote:

> Hi,
> I am using DBCP for a web application. I have a class that initializes 
> the
> connection parameters(min/max values for idle/active) and also provides a
> getConnection() method. In getConnection() I have debug statements that
> print the numActive & maxActive connections and also the numIdle & 
> maxIdle
> connection values. I have a test method that requests for 15 connections 
> in
> a loop and executes a simple qry; i am not closing any of the 
> connections.
>
> At the end of the loop this is the debug message:
> getNumActive/getMaxActive 15/20 getNumIdle/getMaxIdle0/20.
>
> The parameters I had set are:
> 		connectionPool.setMaxActive(20);
> 		connectionPool.setMinIdle(5);
> 		connectionPool.setMaxIdle(20);
> When i look at the connections in oracle, I see only 4 connections from 
> the
> java user. Should I not be seeing the 15 active connections? Am i missing
> some other parameters ?

Your code differs from what you say :)
> 		connectionPool = new GenericObjectPool(null);
> 		connectionPool.setMaxActive(maxConn);//5
> 		connectionPool.setMinIdle(minConn);//20
> 		connectionPool.setMaxIdle(maxConn);//20

If you are passing 5 to MaxIdle, the results of Oracle are in line with 
the DBCP settings.

-- 
John Zoetebier
Web site: http://www.transparent.co.nz



>
> Thanks in advance for any help.
> Arun N
>
> Here's the output
> *****************
> Database Drivers were loaded successfuly
> Creating conn pool, max:20  min:5
> Data source inited successfuly
> Starting to get connections
> Requesting connection0 at 1070472656437
> getNumActive/getMaxActive0/20 getNumIdle/getMaxIdle5/20
> Status after returning a connection
> getNumActive/getMaxActive1/20 getNumIdle/getMaxIdle4/20
> Obtained connection0 at 1070472656500
> Requesting connection1 at 1070472656515
> getNumActive/getMaxActive1/20 getNumIdle/getMaxIdle4/20
> Status after returning a connection
> getNumActive/getMaxActive2/20 getNumIdle/getMaxIdle3/20
> Obtained connection1 at 1070472656515
> Requesting connection2 at 1070472656531
> getNumActive/getMaxActive2/20 getNumIdle/getMaxIdle3/20
> Status after returning a connection
> getNumActive/getMaxActive3/20 getNumIdle/getMaxIdle2/20
> Obtained connection2 at 1070472656531
> Requesting connection3 at 1070472656531
> getNumActive/getMaxActive3/20 getNumIdle/getMaxIdle2/20
> Status after returning a connection
> getNumActive/getMaxActive4/20 getNumIdle/getMaxIdle1/20
> Obtained connection3 at 1070472656546
> Requesting connection4 at 1070472656546
> getNumActive/getMaxActive4/20 getNumIdle/getMaxIdle1/20
> Status after returning a connection
> getNumActive/getMaxActive5/20 getNumIdle/getMaxIdle0/20
> Obtained connection4 at 1070472656562
> Requesting connection5 at 1070472656562
> getNumActive/getMaxActive5/20 getNumIdle/getMaxIdle0/20
> Status after returning a connection
> getNumActive/getMaxActive6/20 getNumIdle/getMaxIdle0/20
> Obtained connection5 at 1070472656625
> Requesting connection6 at 1070472656625
> getNumActive/getMaxActive6/20 getNumIdle/getMaxIdle0/20
> Status after returning a connection
> getNumActive/getMaxActive7/20 getNumIdle/getMaxIdle0/20
> Obtained connection6 at 1070472656687
> Requesting connection7 at 1070472656687
> getNumActive/getMaxActive7/20 getNumIdle/getMaxIdle0/20
> Status after returning a connection
> getNumActive/getMaxActive8/20 getNumIdle/getMaxIdle0/20
> Obtained connection7 at 1070472656765
> Requesting connection8 at 1070472656765
> getNumActive/getMaxActive8/20 getNumIdle/getMaxIdle0/20
> Status after returning a connection
> getNumActive/getMaxActive9/20 getNumIdle/getMaxIdle0/20
> Obtained connection8 at 1070472656843
> Requesting connection9 at 1070472656843
> getNumActive/getMaxActive9/20 getNumIdle/getMaxIdle0/20
> Status after returning a connection
> getNumActive/getMaxActive10/20 getNumIdle/getMaxIdle0/20
> Obtained connection9 at 1070472656921
> Requesting connection10 at 1070472656921
> getNumActive/getMaxActive10/20 getNumIdle/getMaxIdle0/20
> Status after returning a connection
> getNumActive/getMaxActive11/20 getNumIdle/getMaxIdle0/20
> Obtained connection10 at 1070472656984
> Requesting connection11 at 1070472656984
> getNumActive/getMaxActive11/20 getNumIdle/getMaxIdle0/20
> Status after returning a connection
> getNumActive/getMaxActive12/20 getNumIdle/getMaxIdle0/20
> Obtained connection11 at 1070472657046
> Requesting connection12 at 1070472657046
> getNumActive/getMaxActive12/20 getNumIdle/getMaxIdle0/20
> Status after returning a connection
> getNumActive/getMaxActive13/20 getNumIdle/getMaxIdle0/20
> Obtained connection12 at 1070472657109
> Requesting connection13 at 1070472657109
> getNumActive/getMaxActive13/20 getNumIdle/getMaxIdle0/20
> Status after returning a connection
> getNumActive/getMaxActive14/20 getNumIdle/getMaxIdle0/20
> Obtained connection13 at 1070472657234
> Requesting connection14 at 1070472657234
> getNumActive/getMaxActive14/20 getNumIdle/getMaxIdle0/20
> Status after returning a connection
> getNumActive/getMaxActive15/20 getNumIdle/getMaxIdle0/20
> Obtained connection14 at 1070472657312
> Out of loop
>
> Here's the code that initializes the pool
> ******************************************
> 		//Load the Drivers.
> 		try {
> 			Class.forName(driver).newInstance();
> 			System.out.println("Database Drivers were loaded successfuly");
> 		} catch (Exception e) {
> 			System.out.println("Database Drivers could not be loaded: Class for 
> name
> failed" + e);
> 		}
> 		//Set conn pool parameters.
> 		System.out.println("Creating conn pool, max:" + maxConn + "  min:" +
> minConn);
> 		connectionPool = new GenericObjectPool(null);
> 		connectionPool.setMaxActive(maxConn);//5
> 		connectionPool.setMinIdle(minConn);//20
> 		connectionPool.setMaxIdle(maxConn);//20
>
> 		ConnectionFactory connectionFactory = new
> DriverManagerConnectionFactory(URL,null);
> 		PoolableConnectionFactory poolableConnectionFactory = new
> PoolableConnectionFactory
> (connectionFactory,connectionPool,null,null,false,true);
> 		ds = new PoolingDataSource(connectionPool);
> 		try {
> 			//Just making sure the min Connections are created on startup
> 			for(int i=0; i<minConn; i++){
> 				connectionPool.addObject();
> 			}
> 		} catch(Exception e) {
> 			System.out.println(" Could not create conn pool objects"+e);
> 			return false;
> 		}
> 		System.out.println("Data source inited successfuly");
> 		return true;
> ******************************************
> Code that tests the conn pool
>
> 		public static boolean testPool() {
> 			 PoolDataSource ds = new PoolDataSource();
> 			 System.out.println("in the test method");
>
> ds.initDataSource("jdbc:oracle:thin:rtm/rtm@localhost:1521:arun","oracle.jdb
> c.driver.OracleDriver",20,5);
> 		try {
> 			System.out.println("Starting to get connections");
> 			String sql = "Select * from tab";
> 			for(int i=0; i<15; i++) {
> 				System.out.println("Requesting connection" + i + " at " +
> Calendar.getInstance().getTimeInMillis());
> 				Connection conn1 = ds.getConnection();
> 				System.out.println("Obtained connection" + i + " at "  +
> Calendar.getInstance().getTimeInMillis());
> 				Statement st = conn1.createStatement();
> 				st.executeQuery(sql);
> 				//PoolDataSource.CloseConnection(conn1);
> 			}
> 			System.out.println("Out of loop");
> 		} catch (Exception e) { System.out.println("DS " + e); return false;}
> 			return true;
> 		}
> ******************************************
>
>
> ---------------------------------------------------------------------
> 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


DBCP oracle connections less than minActive ?

Posted by Arun Natarajan <an...@gmu.edu>.
Hi,
I am using DBCP for a web application. I have a class that initializes the
connection parameters(min/max values for idle/active) and also provides a
getConnection() method. In getConnection() I have debug statements that
print the numActive & maxActive connections and also the numIdle & maxIdle
connection values. I have a test method that requests for 15 connections in
a loop and executes a simple qry; i am not closing any of the connections.

At the end of the loop this is the debug message:
getNumActive/getMaxActive 15/20 getNumIdle/getMaxIdle0/20.

The parameters I had set are:
		connectionPool.setMaxActive(20);
		connectionPool.setMinIdle(5);
		connectionPool.setMaxIdle(20);
When i look at the connections in oracle, I see only 4 connections from the
java user. Should I not be seeing the 15 active connections? Am i missing
some other parameters ?

Thanks in advance for any help.
Arun N

Here's the output
*****************
Database Drivers were loaded successfuly
Creating conn pool, max:20  min:5
Data source inited successfuly
Starting to get connections
Requesting connection0 at 1070472656437
getNumActive/getMaxActive0/20 getNumIdle/getMaxIdle5/20
Status after returning a connection
getNumActive/getMaxActive1/20 getNumIdle/getMaxIdle4/20
Obtained connection0 at 1070472656500
Requesting connection1 at 1070472656515
getNumActive/getMaxActive1/20 getNumIdle/getMaxIdle4/20
Status after returning a connection
getNumActive/getMaxActive2/20 getNumIdle/getMaxIdle3/20
Obtained connection1 at 1070472656515
Requesting connection2 at 1070472656531
getNumActive/getMaxActive2/20 getNumIdle/getMaxIdle3/20
Status after returning a connection
getNumActive/getMaxActive3/20 getNumIdle/getMaxIdle2/20
Obtained connection2 at 1070472656531
Requesting connection3 at 1070472656531
getNumActive/getMaxActive3/20 getNumIdle/getMaxIdle2/20
Status after returning a connection
getNumActive/getMaxActive4/20 getNumIdle/getMaxIdle1/20
Obtained connection3 at 1070472656546
Requesting connection4 at 1070472656546
getNumActive/getMaxActive4/20 getNumIdle/getMaxIdle1/20
Status after returning a connection
getNumActive/getMaxActive5/20 getNumIdle/getMaxIdle0/20
Obtained connection4 at 1070472656562
Requesting connection5 at 1070472656562
getNumActive/getMaxActive5/20 getNumIdle/getMaxIdle0/20
Status after returning a connection
getNumActive/getMaxActive6/20 getNumIdle/getMaxIdle0/20
Obtained connection5 at 1070472656625
Requesting connection6 at 1070472656625
getNumActive/getMaxActive6/20 getNumIdle/getMaxIdle0/20
Status after returning a connection
getNumActive/getMaxActive7/20 getNumIdle/getMaxIdle0/20
Obtained connection6 at 1070472656687
Requesting connection7 at 1070472656687
getNumActive/getMaxActive7/20 getNumIdle/getMaxIdle0/20
Status after returning a connection
getNumActive/getMaxActive8/20 getNumIdle/getMaxIdle0/20
Obtained connection7 at 1070472656765
Requesting connection8 at 1070472656765
getNumActive/getMaxActive8/20 getNumIdle/getMaxIdle0/20
Status after returning a connection
getNumActive/getMaxActive9/20 getNumIdle/getMaxIdle0/20
Obtained connection8 at 1070472656843
Requesting connection9 at 1070472656843
getNumActive/getMaxActive9/20 getNumIdle/getMaxIdle0/20
Status after returning a connection
getNumActive/getMaxActive10/20 getNumIdle/getMaxIdle0/20
Obtained connection9 at 1070472656921
Requesting connection10 at 1070472656921
getNumActive/getMaxActive10/20 getNumIdle/getMaxIdle0/20
Status after returning a connection
getNumActive/getMaxActive11/20 getNumIdle/getMaxIdle0/20
Obtained connection10 at 1070472656984
Requesting connection11 at 1070472656984
getNumActive/getMaxActive11/20 getNumIdle/getMaxIdle0/20
Status after returning a connection
getNumActive/getMaxActive12/20 getNumIdle/getMaxIdle0/20
Obtained connection11 at 1070472657046
Requesting connection12 at 1070472657046
getNumActive/getMaxActive12/20 getNumIdle/getMaxIdle0/20
Status after returning a connection
getNumActive/getMaxActive13/20 getNumIdle/getMaxIdle0/20
Obtained connection12 at 1070472657109
Requesting connection13 at 1070472657109
getNumActive/getMaxActive13/20 getNumIdle/getMaxIdle0/20
Status after returning a connection
getNumActive/getMaxActive14/20 getNumIdle/getMaxIdle0/20
Obtained connection13 at 1070472657234
Requesting connection14 at 1070472657234
getNumActive/getMaxActive14/20 getNumIdle/getMaxIdle0/20
Status after returning a connection
getNumActive/getMaxActive15/20 getNumIdle/getMaxIdle0/20
Obtained connection14 at 1070472657312
Out of loop

Here's the code that initializes the pool
******************************************
		//Load the Drivers.
		try {
			Class.forName(driver).newInstance();
			System.out.println("Database Drivers were loaded successfuly");
		} catch (Exception e) {
			System.out.println("Database Drivers could not be loaded: Class for name
failed" + e);
		}
		//Set conn pool parameters.
		System.out.println("Creating conn pool, max:" + maxConn + "  min:" +
minConn);
		connectionPool = new GenericObjectPool(null);
		connectionPool.setMaxActive(maxConn);//5
		connectionPool.setMinIdle(minConn);//20
		connectionPool.setMaxIdle(maxConn);//20

		ConnectionFactory connectionFactory = new
DriverManagerConnectionFactory(URL,null);
		PoolableConnectionFactory poolableConnectionFactory = new
PoolableConnectionFactory
(connectionFactory,connectionPool,null,null,false,true);
		ds = new PoolingDataSource(connectionPool);
		try {
			//Just making sure the min Connections are created on startup
			for(int i=0; i<minConn; i++){
				connectionPool.addObject();
			}
		} catch(Exception e) {
			System.out.println(" Could not create conn pool objects"+e);
			return false;
		}
		System.out.println("Data source inited successfuly");
		return true;
******************************************
Code that tests the conn pool

		public static boolean testPool() {
			 PoolDataSource ds = new PoolDataSource();
			 System.out.println("in the test method");

ds.initDataSource("jdbc:oracle:thin:rtm/rtm@localhost:1521:arun","oracle.jdb
c.driver.OracleDriver",20,5);
		try {
			System.out.println("Starting to get connections");
			String sql = "Select * from tab";
			for(int i=0; i<15; i++) {
				System.out.println("Requesting connection" + i + " at " +
Calendar.getInstance().getTimeInMillis());
				Connection conn1 = ds.getConnection();
				System.out.println("Obtained connection" + i + " at "  +
Calendar.getInstance().getTimeInMillis());
				Statement st = conn1.createStatement();
				st.executeQuery(sql);
				//PoolDataSource.CloseConnection(conn1);
			}
			System.out.println("Out of loop");
		} catch (Exception e) { System.out.println("DS " + e); return false;}
			return true;
		}
******************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [DBCP] Deadlock problem?

Posted by Frank Stolze <fr...@directlyhome.com>.
Dirk,

Thank you for your follow-up. I did restart the server between those
thread dumps. They represent the server being in a "hung" state, at
different instances.

In terms of database connections, at that point in time I usually see 4
to 6 connections, all of them in an idle state. The database server
allows 128 connections, and DBCP was at the default setting (8 I
believe?).

I will generate several dumps when I catch another event like this.

Regards,
Frank


On Tue, 2003-12-02 at 18:07, Dirk Verbeeck wrote:
> Actually I don't see a deadlock in the stack traces you provided.
> I see two times 2 threads waiting for a connection
> 
> In the first dump a getConnection from a <c:out> in your products.jsp page and 
> from CSVGenerator called in DataFileGeneratorServlet.
> 
> The second dump again in the CSVGenerator but a different place and also the 
> products.jsp page.
> 
> You probably did restart the server between the two threaddumps?
> Please make a couple of threaddumps with 30 sec inbetween without restarting.
> 
> How did you test the number of available database connections?
> 
> -- Dirk
> 
> Frank Stolze wrote:
> 
> > Hi,
> > 
> > I have been having some problems with Tomcat + DBCP for some time now. I
> > made every effort to find the problem myself and also look through the
> > mailing list archives, but it seems that I'm at a dead end now. Here is
> > my problem:
> > 
> > Tomcat 4.1.27
> > Commons-Pool 1.1
> > Commons-DBCP 1.1
> > PostgreSQL 7.3.3
> > 
> > While everything works beautifully for a while, at some (seemingly)
> > random point in time getting a db connection from the pool fails.
> > Database connections are available, both idle and not yet established.
> > 
> > Configuration:
> > 
> >           <Resource auth="Container" name="jdbc/Public"
> > scope="Shareable" type="javax.sql.DataSource"/>
> >           <ResourceParams name="jdbc/Public">
> >             <parameter>
> >               <name>password</name>
> >               <value>xxxx</value>
> >             </parameter>
> >             <parameter>
> >               <name>url</name>
> >               <value>jdbc:postgresql://localhost:5432/bfth_db</value>
> >             </parameter>
> >             <parameter>
> >               <name>driverClassName</name>
> >               <value>org.postgresql.Driver</value>
> >             </parameter>
> >             <parameter>
> >               <name>username</name>
> >               <value>xxxx</value>
> >             </parameter>
> >           </ResourceParams>
> > 
> > Here are two representative thread dumps:
> 
> threaddumps removed
> 
> > 
> > Any advice would be appreciated!
> > 
> > 
> > Frank
> 
> 
> 
> 
> ---------------------------------------------------------------------
> 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


Re: [DBCP] Deadlock problem?

Posted by Dirk Verbeeck <di...@pandora.be>.
Actually I don't see a deadlock in the stack traces you provided.
I see two times 2 threads waiting for a connection

In the first dump a getConnection from a <c:out> in your products.jsp page and 
from CSVGenerator called in DataFileGeneratorServlet.

The second dump again in the CSVGenerator but a different place and also the 
products.jsp page.

You probably did restart the server between the two threaddumps?
Please make a couple of threaddumps with 30 sec inbetween without restarting.

How did you test the number of available database connections?

-- Dirk

Frank Stolze wrote:

> Hi,
> 
> I have been having some problems with Tomcat + DBCP for some time now. I
> made every effort to find the problem myself and also look through the
> mailing list archives, but it seems that I'm at a dead end now. Here is
> my problem:
> 
> Tomcat 4.1.27
> Commons-Pool 1.1
> Commons-DBCP 1.1
> PostgreSQL 7.3.3
> 
> While everything works beautifully for a while, at some (seemingly)
> random point in time getting a db connection from the pool fails.
> Database connections are available, both idle and not yet established.
> 
> Configuration:
> 
>           <Resource auth="Container" name="jdbc/Public"
> scope="Shareable" type="javax.sql.DataSource"/>
>           <ResourceParams name="jdbc/Public">
>             <parameter>
>               <name>password</name>
>               <value>xxxx</value>
>             </parameter>
>             <parameter>
>               <name>url</name>
>               <value>jdbc:postgresql://localhost:5432/bfth_db</value>
>             </parameter>
>             <parameter>
>               <name>driverClassName</name>
>               <value>org.postgresql.Driver</value>
>             </parameter>
>             <parameter>
>               <name>username</name>
>               <value>xxxx</value>
>             </parameter>
>           </ResourceParams>
> 
> Here are two representative thread dumps:

threaddumps removed

> 
> Any advice would be appreciated!
> 
> 
> Frank




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org