Support Questions

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

DBCP connection pool Issue(Can't load Database Driver) in Windows NiFI 0.70

avatar
Rising Star

Hi all,

I'm using nifi 0.7 windows version and tried to connect mysql data base but it shows following error

9432-err.png

My DBCP settings is

9433-err1.png

and logs says

2016-11-15 15:04:45,209 ERROR [StandardProcessScheduler Thread-8] o.a.n.c.s.StandardControllerServiceNode DBCPConnectionPool[id=47e0b89a-2e72-46d5-956e-f3b2f2b32a3f] Failed to invoke @OnEnabled method due to org.apache.nifi.reporting.InitializationException: Can't load Database Driver 2016-11-15 15:04:45,212 ERROR [StandardProcessScheduler Thread-8] o.a.n.c.s.StandardControllerServiceNode org.apache.nifi.reporting.InitializationException: Can't load Database Driver at org.apache.nifi.dbcp.DBCPConnectionPool.getDriverClassLoader(DBCPConnectionPool.java:199) ~[na:na] at org.apache.nifi.dbcp.DBCPConnectionPool.onConfigured(DBCPConnectionPool.java:162) ~[na:na] at sun.reflect.GeneratedMethodAccessor268.invoke(Unknown Source) ~[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_91] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_91] at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:137) ~[na:na] at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:125) ~[na:na] at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:70) ~[na:na] at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotation(ReflectionUtils.java:47) ~[na:na] at org.apache.nifi.controller.service.StandardControllerServiceNode$1.run(StandardControllerServiceNode.java:308) ~[na:na] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_91] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_91] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_91] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_91] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_91] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_91] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_91] Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_91] at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_91] at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_91] at java.lang.Class.forName0(Native Method) ~[na:1.8.0_91] at java.lang.Class.forName(Class.java:348) ~[na:1.8.0_91] at org.apache.nifi.dbcp.DBCPConnectionPool.getDriverClassLoader(DBCPConnectionPool.java:188) ~[na:na] ... 16 common frames omitted 2016-11-15 15:04:45,213 ERROR [StandardProcessScheduler Thread-8] o.a.n.c.s.StandardControllerServiceNode Failed to invoke @OnEnabled method of DBCPConnectionPool[id=47e0b89a-2e72-46d5-956e-f3b2f2b32a3f] due to org.apache.nifi.reporting.InitializationException: Can't load Database Driver

Thanks

Manikandan

6 REPLIES 6

avatar
Master Guru

Does it work if you replace the back-slashes with forward slashes in the Database Driver Jar Url property?

avatar
Rising Star

Hi @Matt Burgess

Thanks for your Replay.

I tried to change as you said but still facing same error.

This NiFi works under windows platform and is their any specific rule's to follow windows users please guide me

Thanks

Manikandan

avatar
Expert Contributor

i agree with matt... my value for Driver location : file:///Program Files/mysql-connector-java-5.1.39/mysql-connector-java-5.1.39-bin.jar

avatar
Rising Star

Hi @Arsalan Siddiqi

My issue is normally windows directory path looks like E:\connectors\mysql-connector-java-5.1.23-bin.jar

in front need to start as file. For your suggestion i given path like file:///E:\connectors\mysql-connector-java-5.1.23-bin.jar but still not working

Thanks

Manikandan

avatar
Expert Contributor

i am also using windows. although my file is in C drive. try using file:///connectors/mys.....jar if this does not work, try placing the jar in a folder in C drive and use a similar path to the one i posted above.... hopefully it should work

avatar
Rising Star

@Matt Burgess @Arsalan Siddiqi

Now Logs are changed

2016-11-17 10:01:04,640 ERROR [StandardProcessScheduler Thread-3] o.a.n.controller.StandardProcessorNode Failed to invoke @OnScheduled method due to java.lang.RuntimeException: Failed while executing one of processor's OnScheduled task. java.lang.RuntimeException: Failed while executing one of processor's OnScheduled task. at org.apache.nifi.controller.StandardProcessorNode.invokeTaskAsCancelableFuture(StandardProcessorNode.java:1392) ~[na:na] at org.apache.nifi.controller.StandardProcessorNode.access$100(StandardProcessorNode.java:90) ~[na:na] at org.apache.nifi.controller.StandardProcessorNode$1.run(StandardProcessorNode.java:1230) ~[na:na] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_91] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_91] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_91] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_91] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_91] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_91] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_91] Caused by: java.util.concurrent.ExecutionException: java.lang.reflect.InvocationTargetException at java.util.concurrent.FutureTask.report(FutureTask.java:122) [na:1.8.0_91] at java.util.concurrent.FutureTask.get(FutureTask.java:206) [na:1.8.0_91] at org.apache.nifi.controller.StandardProcessorNode.invokeTaskAsCancelableFuture(StandardProcessorNode.java:1375) ~[na:na] ... 9 common frames omitted Caused by: java.lang.reflect.InvocationTargetException: null at sun.reflect.GeneratedMethodAccessor301.invoke(Unknown Source) ~[na:na] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_91] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_91] at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:137) ~[na:na] at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:125) ~[na:na] at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:70) ~[na:na] at org.apache.nifi.controller.StandardProcessorNode$1$1.call(StandardProcessorNode.java:1234) ~[na:na] at org.apache.nifi.controller.StandardProcessorNode$1$1.call(StandardProcessorNode.java:1230) ~[na:na] ... 6 common frames omitted Caused by: java.lang.IllegalStateException: Cannot invoke method public abstract java.sql.Connection org.apache.nifi.dbcp.DBCPService.getConnection() throws org.apache.nifi.processor.exception.ProcessException on Controller Service with identifier 47e0b89a-2e72-46d5-956e-f3b2f2b32a3f because the Controller Service is disabled at org.apache.nifi.controller.service.StandardControllerServiceProvider$1.invoke(StandardControllerServiceProvider.java:161) ~[na:na] at com.sun.proxy.$Proxy91.getConnection(Unknown Source) ~[na:na] at org.apache.nifi.processors.standard.QueryDatabaseTable.setup(QueryDatabaseTable.java:225) ~[na:na] ... 14 common frames omitted