This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Servlets and the fly likes ERROR: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "ERROR: "Could not retrieve connection info from pool"" Watch "ERROR: "Could not retrieve connection info from pool"" New topic
Author

ERROR: "Could not retrieve connection info from pool"

Manikandan Jayaraman
Ranch Hand

Joined: Sep 15, 2004
Posts: 230
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 ]

Regards,<br />Mani<br />SCJP 1.4 (95%)<br />SCWCD 1.4 (94%)
Amol Fuke
Ranch Hand

Joined: Apr 08, 2005
Posts: 129
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.


"There are no mistakes, only lessons"
Manikandan Jayaraman
Ranch Hand

Joined: Sep 15, 2004
Posts: 230
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

Joined: Aug 13, 2004
Posts: 1081


Upon restarting the web server, things start working properly


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


Shailesh


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
Manikandan Jayaraman
Ranch Hand

Joined: Sep 15, 2004
Posts: 230
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

Joined: Aug 13, 2004
Posts: 1081

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

Joined: Feb 17, 2005
Posts: 279
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

Joined: Sep 15, 2004
Posts: 230
May I know where should I configure my Pool Size? Can someone guide me here with respect to Tomcat Server?

Thanks in advance.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Step 4 in the JDBC Datasources section of this page:
http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jndi-resources-howto.html


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Bryan Qeen
Greenhorn

Joined: May 08, 2005
Posts: 3
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

Joined: Jul 08, 2003
Posts: 24183
    
  34

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!


[Jess in Action][AskingGoodQuestions]
Bryan Qeen
Greenhorn

Joined: May 08, 2005
Posts: 3
dear,

is this nick name is ok?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by adhoc:
dear,

is this nick name is ok?


<FIRST_NAME><SPACE><LAST_NAME>

Example:
"Ben Souther"
Bryan Qeen
Greenhorn

Joined: May 08, 2005
Posts: 3
How about this nick name? I think it's a good one, isn't it? :-)
Sorry for every thing.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Yes, it is good.
Thank you and, again, welcome.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ERROR: "Could not retrieve connection info from pool"