Monday, May 25, 2015

FATAL DataSourcePool getDataSourceConnection Can't create a new connection for tera

Error:

FATAL DataSourcePool getDataSourceConnection Can't create a new connection for tera on java:/jdbc/XXXX exception: java.sql.SQLException: com.teradata.jdbc.TeraDriver code: 0 java.sql.SQLException: com.teradata.jdbc.TeraDriver at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:208)at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:157) at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:617)  at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:561)     at org.apache.tomcat.jdbc.pool.ConnectionPool.getConnection(ConnectionPool.java:166) at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:106)        at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:78) at cat.cis.tuf.server.connector.jdbc.DataSourcePool.getConnection(DataSourcePool.java:268)    at cat.cis.tuf.server.connector.jdbc.DataSourcePool.getDataSourceConnection(DataSourcePool.java:165

Scenario:

After configuring the Tomcat connection pool as the resource, i.e, You add the jdbc connection pool details to the server.xml. Once the restart is done, The following error will pop up if the jar files path or the files are missing.

Solution:

if the jar files exist in the libraries path, The probable cause for the error would be the missing jar files. Since it is for the tera database connection the following jar files have to be added to the common.loader in catalina.properties file seperated with a ,.

In my case the common.loader looks like the following.

common.loader=${catalina.home}/../Libraries/teradata, ${catalina.home}/../Libraries/teradata/*.jar

A quick restart after the above change would resolve the issue.

In case, If the jar files are not present. You have to download and add them to the libraries and configure the path in the common.loader.

1 comment: