I'm developing a web-application using the JSF framework and I'm deploying it on a Apache Tomcat 6.0.18. The server is installed on a CentOS5 Linux server.
Sometime, apparently without any reason I get the following exception:
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot get a connection, pool error Timeout waiting for idle object
and the DB cannot be queried anymore (no more connections possible from my application). The only solutions is to restart Tomcat or the machine.
I'm handling user authentication through the Apache Tomcat DataSourceRealm method. My database is an Oracle XE and as a connector I'm using the one supplied by Oracle ojdbc14.jar.
I open connections to my DB with a JNDI Resource. The configuration (from context.xml) is the following one:
I'm closing every connection through a method that close every previously opened instance of the following classes: Connection, Statement, PreparedStatement, ResultSet. I tried also monitoring the number of connection opened at one time and they never overcome a total of 3.
The same happens with the Tomcat Server given in bundle with NetBeans 6.7.
Below a full stack-trace taken from the catalina.out log file.
Thanks for any help
Luca