Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

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

SOLVED Go to solution
Highlighted

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

New Contributor

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

Accepted Solutions

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

Master Guru

@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

6 REPLIES 6

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

Master Guru

@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

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

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

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

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

New Contributor

Thanks Matt Burgess

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

New Contributor

Thanks Matt Clarke

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

New Contributor

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

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

New 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