gpt4 book ai didi

java - Apache NiFi 无法使用 ojdbc6.jar 或 ojdbc8.jar 连接到 Oracle 12c

转载 作者:行者123 更新时间:2023-12-02 09:36:10 25 4
gpt4 key购买 nike

我们正在尝试从 Apache NiFi 连接到 Oracle 12c 数据库。但它根本不起作用:我们收到以下错误:

bdc2314a-669e-1e85-875c-73b035db9ba5
ExecuteSQL[id=bdc2314a-669e-1e85-875c-73b035db9ba5] Unable to execute SQL select query select * from ETSETTRA.APB where rownum < 10 due to java.sql.SQLException: Cannot create JDBC driver of class 'oracle.jdbc.driver.OracleDriver' for connect URL 'jdbc:oracle:thin@//osiXXXX:1521/UTSOFTP'. 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@//osiXXXX:1521/UTSOFTP

配置如下。我尝试了很多其他组合

Driver Configuration

这应该是直接的吗?

完整堆栈跟踪

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@osi3454:1521/UTSOFTP'
    at org.apache.nifi.dbcp.DBCPConnectionPool.getConnection(DBCPConnectionPool.java:474)
    at org.apache.nifi.dbcp.DBCPService.getConnection(DBCPService.java:49)
    at sun.reflect.GeneratedMethodAccessor701.invoke(Unknown Source)
    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.$Proxy126.getConnection(Unknown Source)
    at org.apache.nifi.processors.standard.AbstractExecuteSQL.onTrigger(AbstractExecuteSQL.java:222)
    at org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
    at org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1162)
    at org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:209)
    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@osi3454:1521/UTSOFTP'
    at org.apache.commons.dbcp2.BasicDataSource.createConnectionFactory(BasicDataSource.java:2224)
    at org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2104)
    at org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1563)
    at org.apache.nifi.dbcp.DBCPConnectionPool.getConnection(DBCPConnectionPool.java:470)
    ... 19 common frames omitted
Caused by: java.sql.SQLException: No suitable driver
    at org.apache.commons.dbcp2.BasicDataSource.createConnectionFactory(BasicDataSource.java:2216)
    ... 22 common frames omitted

最佳答案

我认为驱动程序名称不正确:

oracle.jdbc.driver.OracleDriver

对比

oracle.jdbc.OracleDriver

Difference between Oracle jdbc driver classes?

关于java - Apache NiFi 无法使用 ojdbc6.jar 或 ojdbc8.jar 连接到 Oracle 12c,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57498802/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com