tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles So <charles...@mac.com>
Subject DBCP exception; very hard to debug
Date Mon, 28 Apr 2003 05:35:07 GMT
Hello,

I am using DBCP 1.0 with Tomcat 4.1.24. The other Apache Commons I am  
using with DBCP1.0 are:

commons-collections2.1.jar
commons-logging-api.103.jar
commons-pool.101.jar



The webapp I am writing is set to have a maximum of 40 sessions. The  
allowed maximum number of connection to MySQL is 210. The minimum  
number of idle connection is set to 100 at Tomcat level.

Each session uses 5 connections to start doing its work.

The first time I stress my webapp all is fine. I can see 40 sessions  
all used up in Tomcat's Manager.

I then wait until all sessions to time out and stress it again. This  
time it is usually OK too.

However, the 3rd time it is very likely to have thrown *tons* of this  
exception:



DBCP borrowObject failed: java.sql.SQLException: Server connection  
failure during transaction.
Attemtped reconnect 3 times. Giving up.
Exception in Item org.apache.commons.dbcp.DbcpException:  
java.sql.SQLException: Server connection failure during transaction.
Attemtped reconnect 3 times. Giving up.



It seems that some objects are not released by DBCP. All 100  
connections shown in MySQL are idle.


I tried using the nightly snapshot of DBCP, with all the above other  
commons. It is even worse. The webapp cannot even run the first time!

It would complain:

org.apache.jasper.JasperException:  
org.apache.commons.pool.impl.GenericObjectPool: method ()V not found
         at  
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja 
va:254)
         at  
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at  
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at  
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica 
tionFilterChain.java:247)
         at  
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt 
erChain.java:193)
         at  
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv 
e.java:256)
         at  
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i 
nvokeNext(StandardPipeline.java:643)
         at  
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 
80)
         at  
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at  
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv 
e.java:191)
         at  
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i 
nvokeNext(StandardPipeline.java:643)
         at  
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 
80)
         at  
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at  
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:241 
5)
         at  
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java 
:180)
         at  
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i 
nvokeNext(StandardPipeline.java:643)
         at  
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa 
lve.java:171)
         at  
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i 
nvokeNext(StandardPipeline.java:641)
         at  
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java 
:172)
         at  
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i 
nvokeNext(StandardPipeline.java:641)
         at  
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 
80)
         at  
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at  
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. 
java:174)
         at  
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i 
nvokeNext(StandardPipeline.java:643)
         at  
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 
80)
         at  
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at  
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at  
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:261)
         at  
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:360)
         at  
org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:604)
         at  
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java: 
562)
         at  
org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:679)
         at  
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool 
.java:619)
         at java.lang.Thread.run(Thread.java:491)

root cause
javax.servlet.ServletException:  
org.apache.commons.pool.impl.GenericObjectPool: method ()V not found
         at  
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContex 
tImpl.java:536)
         at org.apache.jsp.Index_jsp._jspService(Index_jsp.java:69)
         at  
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at  
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja 
va:210)
         at  
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
         at  
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at  
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica 
tionFilterChain.java:247)
         at  
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt 
erChain.java:193)
         at  
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv 
e.java:256)
         at  
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i 
nvokeNext(StandardPipeline.java:643)
         at  
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 
80)
         at  
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at  
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv 
e.java:191)
         at  
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i 
nvokeNext(StandardPipeline.java:643)
         at  
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 
80)
         at  
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at  
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:241 
5)
         at  
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java 
:180)
         at  
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i 
nvokeNext(StandardPipeline.java:643)
         at  
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa 
lve.java:171)
         at  
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i 
nvokeNext(StandardPipeline.java:641)
         at  
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java 
:172)
         at  
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i 
nvokeNext(StandardPipeline.java:641)
         at  
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 
80)
         at  
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at  
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. 
java:174)
         at  
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i 
nvokeNext(StandardPipeline.java:643)
         at  
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 
80)
         at  
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
         at  
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
         at  
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:261)
         at  
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:360)
         at  
org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:604)
         at  
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java: 
562)
         at  
org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:679)
         at  
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool 
.java:619)
         at java.lang.Thread.run(Thread.java:491)




Just to make sure the JVM is not the bottleneck, I set it to have:

-hotspot -Xms128m -Xmx=550m upon starting



And I have set the system (MacOSX 10.2.5 running JVM 1.3.1) to have the  
following parameters:

cputime         unlimited
filesize        unlimited
datasize        24576 kbytes
stacksize       8192 kbytes
coredumpsize    0 kbytes
memoryuse       unlimited
descriptors     1024
memorylocked    unlimited
maxproc         200


The numbered values are increased either 4 times or  3 times to the  
values shown above.


Please help me with DBCP!!!!
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message