英文:
NiFi 1.9.1 : java.lang.ClassNotFoundException: oracle.jbdc.driver.OrcaleDriver
问题
我尝试通过JBDC将NiFi连接到Oracle,并出现以下错误:
2020-08-13 12:48:48,568 INFO [pool-10-thread-1] o.a.n.c.r.WriteAheadFlowFileRepository 启动FlowFile存储库的检查点
2020-08-13 12:48:48,568 INFO [pool-10-thread-1] o.a.n.c.r.WriteAheadFlowFileRepository 成功在0毫秒内检查点FlowFile存储库,记录数为0
2020-08-13 12:48:59,438 ERROR [Timer-Driven Process Thread-10] o.a.n.c.s.StandardControllerServiceNode DBCPConnectionPool[id=e252cec4-0173-1000-c06c-964690e5251c] 由于org.apache.nifi.reporting.InitializationException而无法调用@OnEnabled方法:无法加载数据库驱动程序: {}
org.apache.nifi.reporting.InitializationException: 无法加载数据库驱动程序
...
Caused by: java.lang.ClassNotFoundException: oracle.jbdc.driver.OrcaleDriver
...
我将ojdbc7.jar
放在/lib/nifi-serve/lib目录中,并在此之后重新启动了NiFi服务。为什么NiFi无法加载驱动程序?
英文:
I try connect NiFi to Oracle over JBDC and have this error:
2020-08-13 12:48:48,568 INFO [pool-10-thread-1] o.a.n.c.r.WriteAheadFlowFileRepository Initiating checkpoint of FlowFile Repository
2020-08-13 12:48:48,568 INFO [pool-10-thread-1] o.a.n.c.r.WriteAheadFlowFileRepository Successfully checkpointed FlowFile Repository with 0 records in 0 milliseconds
2020-08-13 12:48:59,438 ERROR [Timer-Driven Process Thread-10] o.a.n.c.s.StandardControllerServiceNode DBCPConnectionPool[id=e252cec4-0173-1000-c06c-964690e5251c] 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:427)
at org.apache.nifi.dbcp.DBCPConnectionPool.onConfigured(DBCPConnectionPool.java:366)
at sun.reflect.GeneratedMethodAccessor638.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
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:436)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: oracle.jbdc.driver.OrcaleDriver
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at org.apache.nifi.dbcp.DBCPConnectionPool.getDriverClassLoader(DBCPConnectionPool.java:416)
... 16 common frames omitted
2020-08-13 12:48:59,438 ERROR [Timer-Driven Process Thread-10] o.a.n.c.s.StandardControllerServiceNode Failed to invoke @OnEnabled method of DBCPConnectionPool[id=e252cec4-0173-1000-c06c-964690e5251c] due to org.apache.nifi.reporting.InitializationException: Can't load Database Driver
I put ojdbc7.jar
in /lib/nifi-serve/lib and restart nifi service after that.
Why NiFi can't load driver?
答案1
得分: 2
"It is a typo: It's not oracle.jdbc.driver.OrcaleDriver
, it's oracle.jdbc.driver.OracleDriver
."
英文:
It is a typo: It's not oracle.jdbc.driver.OrcaleDriver
, it's oracle.jdbc.driver.OracleDriver
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论