wood burning stoves 2.0*
The moose likes Tomcat and the fly likes Tomcat7 ConnectionPool  DataSource invalid: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat7 ConnectionPool  DataSource invalid: "Cannot create PoolableConnectionFactory (I/O-Fehler: N" Watch "Tomcat7 ConnectionPool  DataSource invalid: "Cannot create PoolableConnectionFactory (I/O-Fehler: N" New topic
Author

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

Timo Munich
Greenhorn

Joined: Nov 16, 2013
Posts: 9
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...
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15952
    
  19

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!


Customer surveys are for companies who didn't pay proper attention to begin with.
 
wood burning stoves
 
subject: Tomcat7 ConnectionPool DataSource invalid: "Cannot create PoolableConnectionFactory (I/O-Fehler: N
 
Similar Threads
adding a Datasource to tomcat jndi
connection pooling with tomcat
JDBC connection error with JNDI resource
JDBC Exception: Cannot create PoolableConnectionFactory (validationQuery didn't return a row
Cannot create PoolableConnectionFactory (Login failed for 'userName') JTDS