Support Questions

Find answers, ask questions, and share your expertise

DBCP connection pool Issue(Can't load Database Driver) in HDP 2.4 NiFi

avatar
Rising Star

I try to access a postgresql through Nifi for that first I try to get json from RestApi through GetHTTP processor, then I try to insert json into postgres through convertJSONToSQL processor in nifi. While initializing DBCP connection I got "DBCPConnectionPool[id=27273afd-ed82-48f4-aaae-d9f265d72769] Failed to invoke @OnEnabled method due to org.apache.nifi.reporting.InitializationException: Can't load Database Driver". I attach my DBCPconnectionpool configure controller service below.

16324-screenshot-from-2017-06-14-134016.png

1 ACCEPTED SOLUTION

avatar
Master Mentor

@Narasimma varman

Try configuring the "Database Driver Jar Url" property with the absolute path to you "postgresql-42.1.1.jre7.jar" file.

for example:

c:/post/postgresql-42.1.1.jre7.jar

/post/postgresql-42.1.1.jre7.jar

Also check out the nifi-app.log for a full stack trace that may follow the above ERROR that may give more detail on why it can't load the file.

Thanks,

Matt

View solution in original post

6 REPLIES 6

avatar
Master Mentor

@Narasimma varman

Try configuring the "Database Driver Jar Url" property with the absolute path to you "postgresql-42.1.1.jre7.jar" file.

for example:

c:/post/postgresql-42.1.1.jre7.jar

/post/postgresql-42.1.1.jre7.jar

Also check out the nifi-app.log for a full stack trace that may follow the above ERROR that may give more detail on why it can't load the file.

Thanks,

Matt

avatar
Master Guru

Or try adding an extra slash before your path (see here for explanation):

file:///post/postgresql-42.1.1.jre7.jar

avatar
Rising Star

Thanks Matt Burgess

avatar
Rising Star

Thanks Matt Clarke

avatar
Explorer

Hi @Matt Burgess,

I am facing the same problem and the solution you suggested is not working for me. Can u provide with some alternative solution. Configuration and error is given below. Nor the solution by Matt Clarke is working for us.

44457-error4.png

44458-error41.png

avatar
Contributor

Hello @Matt Burgess .


I am using the CaptureChangesMysql processor to read the events data from mysql but it it failing with the connection error as "org.apache.nifi.reporting.initializationexception can't load database driver"

screenshots are attached for the reference .

Mysql Driver path: file:////Users/kiran/Downloads/mysql/mysql-connector-java-8.0.17.jar


Environment :

Aapache nifi :1.7.0

Mysql 8.0.17

OS : MacOS 10.14.4

110361-screenshot-2019-08-13-at-55200-pm.png


110371-screenshot-2019-08-13-at-55802-pm.png