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 (Can't load database driver) on Windows with Redshift Connection

Highlighted

DBCP Connection Pool (Can't load database driver) on Windows with Redshift Connection

New Contributor
Hello - 

I am running Nifi on a GCP VM. Debian GNU Linux 9. I am accessing the nifi GUI from a Windows 10 laptop via Chrome (running as Admin).

I have a DBCP Connection Pool configured for an AWS Redshift instance. The configuration settings are:

Database Connection URL: jdbc:redshift://***
Database Driver Class Name: com.amazon.redshift.jdbc42.Driver
Database Driver Location(s): file:///C:/Users/mccor/Desktop/MigrateRedshiftToBigQuery/RedshiftJDBC42-1.2.12.1017.jar

For the driver locations, I've tried all of the following:

file:///C:\Users\mccor\Desktop\MigrateRedshiftToBigQuery\RedshiftJDBC42-1.2.12.1017.jar

file:///C:/Users/mccor/Desktop/MigrateRedshiftToBigQuery/RedshiftJDBC42-1.2.12.1017.jar

file:///Users/mccor/Desktop/MigrateRedshiftToBigQuery/RedshiftJDBC42-1.2.12.1017.jar

file:///Users\mccor\Desktop\MigrateRedshiftToBigQuery\RedshiftJDBC42-1.2.12.1017.jar

file:///c:/RedshiftJDBC42-1.2.12.1017.jar

file:///var/tmp/RedshiftJDBC42-1.2.12.1017.jar -- Tried on nifi server

And probably some others that I can't remember. For each one, I get a "Can't load database driver" error.

There doesn't appear to be any more info in the nifi-app.log file:

2018-05-24 11:10:14,657 ERROR [Timer-Driven Process Thread-2] o.a.n.c.s.StandardControllerServiceNode Failed to invoke @OnEnabled method of DBCPConnectionPool[id=7d087cd4-238e-3baa-81b9-bab1dbcb56fa] due to org.apache.nifi.reporting.InitializationException: Can't load Database Driver<br>2018-05-24 11:10:19,950 INFO [NiFi Web Server-103] o.a.n.c.s.StandardProcessScheduler Disabling DBCPConnectionPool[id=7d087cd4-238e-3baa-81b9-bab1dbcb56fa]2018-05-24 11:10:20,564 INFO [Flow Service Tasks Thread-2] o.a.nifi.controller.StandardFlowService Saved flow controller org.apache.nifi.controller.FlowController@63baa219 // Another save pending = false2018-05-24 11:10:44,658 ERROR [Timer-Driven Process Thread-2] o.a.n.c.s.StandardControllerServiceNode DBCPConnectionPool[id=7d087cd4-238e-3baa-81b9-bab1dbcb56fa] 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)<br>        at org.apache.nifi.dbcp.DBCPConnectionPool.onConfigured(DBCPConnectionPool.java:198)<br>        at sun.reflect.GeneratedMethodAccessor390.invoke(Unknown Source)<br>        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)        at java.lang.reflect.Method.invoke(Method.java:498)<br>        at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:137)<br>        at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:125)<br>        at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:70)        at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotation(ReflectionUtils.java:47)<br>        at org.apache.nifi.controller.service.StandardControllerServiceNode$2.run(StandardControllerServiceNode.java:419)<br>        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)<br>        at java.util.concurrent.FutureTask.run(FutureTask.java:266)<br>        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)<br>        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)<br>        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)<br>        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)        <br>	at java.lang.Thread.run(Thread.java:748)Caused by: java.lang.ClassNotFoundException: com.amazon.redshift.jdbc42.Driver        <br>	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)<br>	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)        <br>	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)        <br>	at java.lang.Class.forName0(Native Method)        <br>	at java.lang.Class.forName(Class.java:348)        <br>	at org.apache.nifi.dbcp.DBCPConnectionPool.getDriverClassLoader(DBCPConnectionPool.java:238)  
	... 16 common frames omitted
2018-05-24 11:10:44,658 ERROR [Timer-Driven Process Thread-2] o.a.n.c.s.StandardControllerServiceNode Failed to invoke @OnEnabled method of DBCPConnectionPool[id=7d087cd4-238e-3baa-81b9-bab1dbcb56fa] due to org.apache.nifi.reporting.InitializationException: Can't load Database Driver
2018-05-24 11:11:53,196 INFO [Write-Ahead Local State Provider Maintenance] org.wali.MinimalLockingWriteAheadLog org.wali.MinimalLockingWriteAheadLog@2aeb3f3b checkpointed with 6 Records and 0 Swap Files in 5 milliseconds (Stop-the-world time = 1 milliseconds, Clear Edit Logs time = 1 millis), max Transaction ID 172018-05-24 11:11:55,748 INFO [pool-10-thread-1] o.a.n.c.r.WriteAheadFlowFileRepository Initiating checkpoint of FlowFile Repository

I'd really appreciate any help here. There just doesn't seem to a combination that works.

Don't have an account?
Coming from Hortonworks? Activate your account here