Nifi 1.11.3无法创建类'oracle.jdbc.driver.OracleDriver'的JDBC驱动程序

问题描述 投票:0回答:1

我正在尝试将一台服务器上的Nifi 1.11.3连接到另一台远程服务器上的Oracle Express Edition 18c。

我正在使用处理器ExecuteSQL。

到目前为止,我已经尝试了以下步骤来解决该错误:

  1. 在/ lib下添加了ojdbc8.jar文件,并重新启动了nifi服务。
  2. 在“数据库驱动程序位置”设置下,我添加了确切的驱动程序名称,但存在相同的错误。
  3. 已使用用户名/密码@ //:1521 /服务名检查了从sqlplus与DB的连接,并已连接到DB。

DBCPConnectionPool设置如下:

enter image description here

nifi-app.log如下:

2020-03-12 15:09:55,031 INFO [Flow Service Tasks Thread-1] o.a.nifi.controller.StandardFlowService Saved flow controller org.apache.nifi.controller.FlowController@498c52f9 // Another save pending = false
2020-03-12 15:09:55,758 ERROR [Timer-Driven Process Thread-7] o.a.nifi.processors.standard.ExecuteSQL ExecuteSQL[id=c86ad1a5-0170-1000-d62b-9bdd35868a4c] Unable to execute SQL select query select * from customers due to org.apache.nifi.processor.exception.ProcessException: java.sql.SQLException: Cannot create JDBC driver of class 'oracle.jdbc.driver.OracleDriver' for connect URL 'jdbc:oracle:thin@//server_url:1521/XEPDB1'. No FlowFile to route to failure: org.apache.nifi.processor.exception.ProcessException: java.sql.SQLException: Cannot create JDBC driver of class 'oracle.jdbc.driver.OracleDriver' for connect URL 'jdbc:oracle:thin@//server_url:1521/XEPDB1'
org.apache.nifi.processor.exception.ProcessException: java.sql.SQLException: Cannot create JDBC driver of class 'oracle.jdbc.driver.OracleDriver' for connect URL 'jdbc:oracle:thin@//server_url:1521/XEPDB1'
        at org.apache.nifi.dbcp.DBCPConnectionPool.getConnection(DBCPConnectionPool.java:444)
        at org.apache.nifi.dbcp.DBCPService.getConnection(DBCPService.java:55)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.nifi.controller.service.StandardControllerServiceInvocationHandler.invoke(StandardControllerServiceInvocationHandler.java:87)
        at com.sun.proxy.$Proxy91.getConnection(Unknown Source)
        at org.apache.nifi.processors.standard.AbstractExecuteSQL.onTrigger(AbstractExecuteSQL.java:236)
        at org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
        at org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1176)
        at org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:213)
        at org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:117)
        at org.apache.nifi.engine.FlowEngine$2.run(FlowEngine.java:110)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
        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.sql.SQLException: Cannot create JDBC driver of class 'oracle.jdbc.driver.OracleDriver' for connect URL 'jdbc:oracle:thin@//server_url:1521/XEPDB1'
        at org.apache.commons.dbcp2.DriverFactory.createDriver(DriverFactory.java:75)
        at org.apache.commons.dbcp2.BasicDataSource.createConnectionFactory(BasicDataSource.java:472)
        at org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:538)
        at org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:753)
        at org.apache.nifi.dbcp.DBCPConnectionPool.getConnection(DBCPConnectionPool.java:440)
        ... 20 common frames omitted
Caused by: java.sql.SQLException: No suitable driver
        at org.apache.commons.dbcp2.DriverFactory.createDriver(DriverFactory.java:68)
        ... 24 common frames omitted
2020-03-12 15:09:55,758 DEBUG [Timer-Driven Process Thread-7] o.a.nifi.processors.standard.ExecuteSQL ExecuteSQL[id=c86ad1a5-0170-1000-d62b-9bdd35868a4c] has chosen to yield its resources; will not be scheduled to run again for 1000 milliseconds
2020-03-12 15:09:56,172 INFO [NiFi Web Server-22] o.a.n.c.s.StandardProcessScheduler Stopping ExecuteSQL[id=c86ad1a5-0170-1000-d62b-9bdd35868a4c]
2020-03-12 15:09:56,172 INFO [NiFi Web Server-22] o.a.n.controller.StandardProcessorNode Stopping processor: ExecuteSQL[id=c86ad1a5-0170-1000-d62b-9bdd35868a4c]
2020-03-12 15:09:56,176 INFO [Timer-Driven Process Thread-3] o.a.n.c.s.TimerDrivenSchedulingAgent Stopped scheduling ExecuteSQL[id=c86ad1a5-0170-1000-d62b-9bdd35868a4c] to run
2020-03-12 15:09:56,551 INFO [Flow Service Tasks Thread-1] o.a.nifi.controller.StandardFlowService Saved flow controller org.apache.nifi.controller.FlowController@498c52f9 // Another save pending = false
2020-03-12 15:10:05,963 INFO [Write-Ahead Local State Provider Maintenance] org.wali.MinimalLockingWriteAheadLog org.wali.MinimalLockingWriteAheadLog@738b93a8 checkpointed with 1 Records and 0 Swap Files in 14 milliseconds (Stop-the-world time = 4 milliseconds, Clear Edit Logs time = 5 millis), max Transaction ID 6

请让我知道我要去哪里错了。

关于,比沙尔

jdbc apache-nifi oracle18c
1个回答
0
投票

发现问题!在瘦身后我错过了一个“:”。

我使用的是jdbc:oracle:thin@,应该是jdbc:oracle:thin:@

我这是一个非常愚蠢的错误!

© www.soinside.com 2019 - 2024. All rights reserved.