Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

Exception in DBCPConnectionPool when using ExecuteSQL

New Contributor

I use DBCPConnectionPool to connect to impala with JDBC. I've pointed to a folder containing the Impala JDBC Driver from Cloudera and all of its dependencies.

I've set the Driver Class name as:

com.cloudera.impala.jdbc41.Driver
The Connection URL looks something like that:
 jdbc:impala://server:port/default;AuthMech=0;

Enabling the Controller Service causes no error but when I enable the ExecuteSQL it throws an exception:
 failed to process session due to java.lang.NoClassDefFoundError: Could not initialize class com.cloudera.impala.core.ImpalaJDBCDriver: Could not initialize class com.cloudera.impala.core.ImpalaJDBCDriver

When I've updated the drivers, I received a different exception:

Unable to execute query select * from table_name limit 1; due to org.apache.nifi.processor.exception.ProcessException: org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'com.cloudera.impala.jdbc41.Driver' for connect URL 'jdbc:impala://server:port/db;AuthMech=0;'. No FlowFile to route to failure: org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'com.cloudera.impala.jdbc41.Driver' for connect URL 'jdbc:impala://server:port/db;AuthMech=0;'. 

stack trace from nifi-app.log:

 java.lang.NoClassDefFoundError: Could not initialize class com.cloudera.impala.core.ImpalaJDBCDriver
 at java.lang.Classs.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.cloudera.dsi.core.impl.DSIDriverFactory.createDriver(Unknown Source)
at com.cloudera.jdbc.common.AbstractDriver.doInitialize(Unknown Source)
at com.cloudera.jdbc.common.AbstractDriver.connect(Unknown Source)
at org.apache.nifi.dbcp.DriverShim.connect(DriverShim.java:46)
at org.apache.commons.dbcpDriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory:1556)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
at org.apache.comons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
at org.apache.nifi.dbcp.DBCPConnectionPool.getConnection(DBCPConnectionPool.java:272)
at sun.reflect.Method.invoke(Method.java:498)
at org.apache.nifi.controller.service.StandardControllerServiceInvocationHandler.invoke(StandardControllerServiceInvocationHandler:89)
at com.sun.proxy.$Proxy453.getConnection(Unknown Source)
at org.apache.nifi.processors.standarad.ExecuteSQL.onTrigger(ExecuteSQL.java:199)
at org.apache.nifi.processor.AbsractProcessor.onTrigger(AbstractProcessor.java:27)
at org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1119)
at org.apache.nifi.controller.tasks.ContinuallyRunPRocessorTask.call(ContinuallyRunProcessorTask.java:147)
org.apache.nifi.controller.tasks.ContinuallyRunPRocessorTask.call(ContinuallyRunProcessorTask.java:47)
at or.apache.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:128)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndREset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPool.Executor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)


I'm using NiFi 1.4.0 and I have all of the dependencies in one folder with the jdbc driver, with no sub folders.
Any thoughts?

1 ACCEPTED SOLUTION

New Contributor

After restarting the servers it suddenly worked. Really strange. Thanks anyway!

View solution in original post

4 REPLIES 4

Super Guru

Is there anything else underneath that stack trace in nifi-app.log? There is usually a Caused By with a ClassNotFoundException or something like that.

New Contributor

Unfortunately no..

Super Guru

Is it possible to share your nifi-app.log on this question? Also, does this driver work from other utilities (Squirrel SQL, e.g.)?

New Contributor

After restarting the servers it suddenly worked. Really strange. Thanks anyway!

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.