• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ERROR: "Could not retrieve connection info from pool"

 
Manikandan Jayaraman
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,

I have been a AVID listener/responder in SCJP Forum but new to this Servlet Discussions. I dont have much of working exposure towards servlets, but know the fundamentals of it.

My application is working in Struts/JSPs and I get this following error, when using any link on my 'Web Interface', after sometime. Upon restarting the web server, things start working properly. This error is not application-specific but it is a servlet exception. The error that gets displayed is :

javax.servlet.ServletException: Could not retrieve connection info from pool, cause: Timeout waiting for idle object

at org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:545)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:486)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
... ... ...


The above error could be due to some improper coding in the application. But, I want to know, what all could be the possible cause for this kind of error.

If I could get some pointers in this direction, I can proceed in solving this. The application is in production and is used by a lot of users (> 500).

Thanks in advance,
_Mani

[ April 25, 2005: Message edited by: Manikandan Jayaraman ]
[ April 25, 2005: Message edited by: Manikandan Jayaraman ]
 
Amol Fuke
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which server you are using?

Please see your connection pool setting in server.I mean have you assigned enough connections for the application.I dont remember the exact properties but there are max connection,max connections live etc..

Please check those settings. You might get some clue.
 
Manikandan Jayaraman
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Tomcat web server. I am not able to find the properties regarding connection pooling in Tomcat Administration and Tomcat Manager.

Where should these details be configured?
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Upon restarting the web server, things start working properly


Are you sure that connection in code are being closed every where after use.


Shailesh
 
Manikandan Jayaraman
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep. This is one of the reason. People who coded the previous version of the application have found problems in closing the cursors. So they left them open

Now that number of users have increased, we face resource shortage, i believe. Even they know that they haven't closed the cursors but still...

May be, I thought we could get some other solution for timebeing so that I can suggest them. I am searching for other solutions as well.

Help me in other directions.
 
Shailesh Chandra
Ranch Hand
Posts: 1082
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Manikandan Jayaraman:
Yep. This is one of the reason. People who coded the previous version of the application have found problems in closing the cursors. So they left them open


you know the bottleneck of system ! now decision is your how to handle it


Shailesh
 
vjy chin
Ranch Hand
Posts: 279
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had similar experience in having not closing the connection pool. I tried to fix it using shortcuts, but it didnt work. One thing was I increased the pool size. But again after little longer than usual, we had the same pbm.

So the main thing is to check where all you use the connection, check if you are closing the connection. Also ensure that you are closing the connections in a catch block, since if some errors come, that connection might be left hanging.

Hope this helps
 
Manikandan Jayaraman
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May I know where should I configure my Pool Size? Can someone guide me here with respect to Tomcat Server?

Thanks in advance.
 
Bryan Qeen
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try opening $CATALINA_HOME\conf\server.xml or your strut-config
.xml file. It might have the same sysntax as followings:

strut-config.xml:

<Resource
auth="Container"
description="..."
name="jdbc/irisINF"
type="javax.sql.DataSource"
driverClassName=".."
username="xxxxxx"
password="xxxxxx"
url="jdbc:..."
maxActive="20"
maxIdle="20"
maxWait="5000"
/>

server.xml:

<ResourceParams name="yourresource">
...
name>username</name>
<value>test</value>
</parameter>
<parameter>
<name>password</name>
<value>test</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>20</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>10</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>-1</value>
</parameter>
</ResourceParams>
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Mr. NPE,

Welcome to JavaRanch!

In your haste to come in and ask a question, you seem to have missed reading our policy on display names, which quite clearly states that you must use a real (sounding) first and last name for your display name -- no joke names, "handles," or last initials are acceptable, no "exceptions" You can fix your display name here. Thanks for your cooperation!
 
Bryan Qeen
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dear,

is this nick name is ok?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by adhoc:
dear,

is this nick name is ok?


<FIRST_NAME><SPACE><LAST_NAME>

Example:
"Ben Souther"
 
Bryan Qeen
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about this nick name? I think it's a good one, isn't it? :-)
Sorry for every thing.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it is good.
Thank you and, again, welcome.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic