Nifi 1.11.3 Не удается создать драйвер JDB C класса 'oracle .jdb c .driver.OracleDriver' - PullRequest
0 голосов
/ 12 марта 2020

Я пытаюсь подключить Nifi 1.11.3 на одном сервере, к Oracle Express Edition 18 c на другом удаленном сервере.

Я использую процессор Execute SQL.

Я до сих пор пытался исправить ошибку:

  1. добавил файл ojdbc8.jar в / lib и перезапустил службы nifi.
  2. в базе данных Установив расположение драйвера, я добавил точное имя драйвера, но с той же ошибкой.
  3. проверил соединение с БД из sqlplus, используя имя пользователя / пароль @ //: 1521 / servicename, и он соединяется с БД.

Параметры 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

Пожалуйста, дайте мне знать, где я иду не так.

С уважением, Бишал

1 Ответ

0 голосов
/ 13 марта 2020

Нашел проблему! Мне не хватало ":" после худого.

Я использовал jdbc:oracle:thin@, это должно быть jdbc:oracle:thin:@

Очень глупая ошибка с моей стороны!

...