Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Tomcat7 ConnectionPool DataSource invalid: "Cannot create PoolableConnectionFactory (I/O-Fehler: N  RSS feed

Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, maybe anyone can help me, after I spend hours to figure out that problem an I already read essential parts of tomcat documentation:

I have to create a Tomcat-Datasource Pool. To make things easier I have created a small project testweb to spot the essential things:
I use Tomcat 7, Oracle-DB 12 / ojdbc7.jar in Tomcat/lib

Following the documentation I created my context.xml under testweb/META-INF/context.xml in this way:

(I am very sure, that these values are absolutely correct and I have tested this via JDBC-Connection and this works fine)

in addition also I setup my web.xml like this:

As I mentioned before I placed the ojdbc7.jar in the tomcat/lib.

To test the pooling I placed a jsp in the web-project. This is taken from apache and should be fine.

After deploying and calling the jsp I got the error, that the PoolableConnectionFactory cannot be created:

with root cause
javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "Cannot create PoolableConnectionFactory (I/O-Fehler: NL Exception was generated)"

Maybe anybody can give me some help on this...
Posts: 19450
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Connection pool definitions can be frustrating to diagnose.

Most commonly, one of the following is at fault:

1. A pool attribute name is mis-spelled or mis-capitalized. This is the one that usually afflicts me.

2. The JDBC URL is incorrect. Your sample URL spans more than one line, and this is a possible problem if that is actually how you coded it.

3. There is a classpath conflict. The driver jar is in conflict with another driver in the TOMCAT/lib directory, a driver jar was placed in the WAR, or no JAR was supplied.

4. The JNDI pathname is incorrect. Note that the JNDI path in the Context and in the web.xml are relative paths, but the full path is needed by the application code: "java:comp/env/jdbc/MyDS".

5. There is a conflict on the Context definition. An external Context (in TOMCAT/conf/Catalina/localhost) will override an internal (WAR) context.xml. Also, if you re-deploy the webapp as a WAR and the default Tomcat settings are in effect, the WAR would have been "exploded" into an unzipped directory structure of the name name as the WAR within TOMCAT/webapps. But updating (replacing) the WAR file will not update the exploded war! Tomcat will ignore the newer WAR file and continue to use the obsolete WAR directory!
A wop bop a lu bob a womp bam boom. Tutti frutti ad:
Rocket Oven Kickstarter - from the trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!