20070414 Saturday April 14, 2007

Cannot get a connection, pool exhausted

I kept getting the following error on a web app that was using Tomcat's built in connection pooling:

Cannot get a connection, pool exhausted

This was followed with a large, mostly unhelpful stack trace. It seems that a connection was not being closed properly somewhere in the application, but there was no clue as to where. Fortunately, I found this nice piece of duct tape to patch the app until I had time to properly debug it. Find the location in context.xml or server.xml where you allocate the JNDI database resource, then modify the <Resource/> tag, adding the following attributes:

removeAbandoned="true"
removeAbandonedTimeout="60"
logAbandoned="true"

This allows Tomcat to recover JDBC connections that have not been closed and have not been used for 60 seconds.

 

Posted by rickg ( Apr 14 2007, 08:16:55 PM PDT ) Permalink Comments [0]
20070406 Friday April 06, 2007

Installing Gnome from the command line

I installed a CentOS server without a GUI recently, then decided after the fact that some things would be easier with a GUI. I envisioned a long, arduous process to get X Windows and Gnome installed, but it was really use a one line command (Ubuntu users, prefix this with the obligitory "sudo"):

yum -y groupinstall gnome

After that, yum happily downloaded and installed everything for me. Once it was done (about an hour later), I was able to start Gnome by typing three little letters

gdb

I like it when stuff is easy!

Posted by rickg ( Apr 06 2007, 04:20:22 AM PDT ) Permalink Comments [0]