Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

How to update Driver Class for DBCPConnectionPool for NIFI - Hive

avatar
New Contributor

I am aware of PutHiveSQL processor , but want to use DBCPConnectionPool

43775-hive-nifi-controller.png

Error :- 2017-11-30 11:26:05,569 ERROR [StandardProcessScheduler Thread-2] o.a.n.c.s.StandardControllerServiceNode DBCPConnectionPool[id=0160100a-8103-194b-50a7-ce556048b78e] Failed to invoke @OnEnabled method due to org.apache.nifi.reporting.InitializationException: Can't load Database Driver: {} org.apache.nifi.reporting.InitializationException: Can't load Database Driver at org.apache.nifi.dbcp.DBCPConnectionPool.getDriverClassLoader(DBCPConnectionPool.java:249) at org.apache.nifi.dbcp.DBCPConnectionPool.onConfigured(DBCPConnectionPool.java:198) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

1 REPLY 1

avatar
Master Guru

It is highly recommended to not put your JDBC driver JAR(s) in NiFi's lib/ directory, as they can disturb the behavior of the other components in the system. I recommend a separate path containing the driver JAR and all its dependencies in a flat directory. Also on Windows you may need to use the URL style "file://C/" or just "/" instead of "C:\" but I'm not sure about that part.

Another caveat with Hive drivers is that some (including the official Apache Hive JDBC driver that comes with NiFi's Hive bundle) do not support all JDBC methods, such as setQueryTimeout(), or have different mechanisms for getting at table metadata (from the ResultSetMetaData rather than DatabaseMetaData or vice versa) than what is used by ExecuteSQL. Those reasons are why there are SelectHiveQL and PutHiveQL processors, so the Hive driver could be included and the processors can perform any driver-specific functions/workarounds as necessary. So you may find that the SQL processors do not work with your Hive driver, but I am not familiar with that driver so I can't say for sure. If you see errors such as "Method not supported", then this usually indicates the scenario I'm talking about.