0

I have been trying to read data from a Mysql Database with Nifi. But the configuration gives error saing org.apache.nifi.reporting.InitializationException: Can't load Database Driver.

The log is shown below.

2020-12-04 14:14:50,165 ERROR [Timer-Driven Process Thread-5] o.a.n.c.s.StandardControllerServiceNode Failed to invoke @OnEnabled method of DBCPConnectionPool[id=2c88a867-0176-1000-e9a7-198529e6e7dd] due to org.apache.nifi.reporting.InitializationException: Can't load Database Driver

Vishnu.chalil@COK-A-00019 MINGW64 /d/RSC/nifi-1.12.1/logs
$ tail nifi-app.log  --lines=50
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:835)
Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.driver
        at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:436)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:415)
        at org.apache.nifi.dbcp.DBCPConnectionPool.getDriverClassLoader(DBCPConnectionPool.java:456)
        ... 16 common frames omitted
2020-12-04 14:14:20,160 ERROR [Timer-Driven Process Thread-8] o.a.n.c.s.StandardControllerServiceNode Failed to invoke @OnEnabled method of DBCPConnectionPool[id=2c88a867-0176-1000-e9a7-198529e6e7dd] due to org.apache.nifi.reporting.InitializationException: Can't load Database Driver
2020-12-04 14:14:20,658 INFO [Flow Service Tasks Thread-2] o.a.nifi.controller.StandardFlowService Saved flow controller org.apache.nifi.controller.FlowController@1992976b // Another save pending = false
2020-12-04 14:14:39,842 INFO [pool-12-thread-1] o.a.n.c.r.WriteAheadFlowFileRepository Initiating checkpoint of FlowFile Repository
2020-12-04 14:14:39,869 INFO [pool-12-thread-1] o.a.n.wali.SequentialAccessWriteAheadLog Checkpointed Write-Ahead Log with 2036 Records and 0 Swap Files in 25 milliseconds (Stop-the-world time = 2 milliseconds), max Transaction ID 5979631
2020-12-04 14:14:39,869 INFO [pool-12-thread-1] o.a.n.c.r.WriteAheadFlowFileRepository Successfully checkpointed FlowFile Repository with 2036 records in 26 milliseconds
2020-12-04 14:14:50,164 ERROR [Timer-Driven Process Thread-5] o.a.n.c.s.StandardControllerServiceNode StandardControllerServiceNode[service=DBCPConnectionPool[id=2c88a867-0176-1000-e9a7-198529e6e7dd], versionedComponentId=null, processGroup=StandardProcessGroup[identifier=285886af-0176-1000-2ec1-fe393bb8b053,name=NiFi Flow], active=true] 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:467)
        at org.apache.nifi.dbcp.DBCPConnectionPool.onConfigured(DBCPConnectionPool.java:406)
        at jdk.internal.reflect.GeneratedMethodAccessor461.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:567)
        at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:142)
        at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:130)
        at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotations(ReflectionUtils.java:75)
        at org.apache.nifi.util.ReflectionUtils.invokeMethodsWithAnnotation(ReflectionUtils.java:52)
        at org.apache.nifi.controller.service.StandardControllerServiceNode$2.run(StandardControllerServiceNode.java:432)
        at org.apache.nifi.engine.FlowEngine$2.run(FlowEngine.java:110)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:835)
Caused by: java.lang.ClassNotFoundException: com.mysql.jdbc.driver
        at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:436)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:415)
        at org.apache.nifi.dbcp.DBCPConnectionPool.getDriverClassLoader(DBCPConnectionPool.java:456)
        ... 16 common frames omitted
2020-12-04 14:14:50,165 ERROR [Timer-Driven Process Thread-5] o.a.n.c.s.StandardControllerServiceNode Failed to invoke @OnEnabled method of DBCPConnectionPool[id=2c88a867-0176-1000-e9a7-198529e6e7dd] due to org.apache.nifi.reporting.InitializationException: Can't load Database Driver.

I will attach the screenshot of the configuratin below.

enter image description here

What could be the problem here?

2
  • Have you tried com.mysql.jdbc.Driver? Commented Dec 4, 2020 at 10:55
  • @Sdairs It did sove work. Commented Dec 4, 2020 at 11:36

1 Answer 1

2

The answer was simple. The it was com.jdbc.mysql.driver and should have been com.jdbc.mysql.Driver.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.