Cristiano Ronado 2022-09-26 13:23
浏览 7
已结题

flinkCDC同步oracle报错

问题遇到的现象和发生背景

在测试flink-CDC 同步oracle 遇到报错,不知道是什么原因
报错如下

用代码块功能插入代码,请勿粘贴截图

Exception in thread "main" org.apache.flink.api.common.InvalidProgramException: com.ververica.cdc.connectors.oracle.OracleValidator@ea1a8d5 is not serializable. The object probably contains or references non serializable fields.
at org.apache.flink.api.java.ClosureCleaner.clean(ClosureCleaner.java:164)
at org.apache.flink.api.java.ClosureCleaner.clean(ClosureCleaner.java:132)
at org.apache.flink.api.java.ClosureCleaner.clean(ClosureCleaner.java:69)
at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.clean(StreamExecutionEnvironment.java:2053)
at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.addSource(StreamExecutionEnvironment.java:1737)
at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.addSource(StreamExecutionEnvironment.java:1720)
at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.addSource(StreamExecutionEnvironment.java:1689)
at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.addSource(StreamExecutionEnvironment.java:1675)
at com.wujie.CDC.OracleCDCTest.main(OracleCDCTest.java:77)
Caused by: java.io.NotSerializableException: com.ververica.cdc.connectors.oracle.OracleValidator

程序代码

StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(1);
        Properties pros = new Properties();
        pros.setProperty("debezium.log.mining.strategy", "online_catalog");
        pros.setProperty("debezium.log.mining.continuous.mine", "true");
        DebeziumSourceFunction<String> sourceFunction = OracleSource.<String>builder()
                .hostname("172.22.5.151")
                .port(1521)
                .database("helowin")
                .schemaList("ZHOU")
                .tableList("ZHOU.STUDENT_INFO")
                .username("ZHOU")
                .password("123456")
                .debeziumProperties(pros)
                .deserializer(new CustomDebeziumDeserializationSchema())
                .startupOptions(StartupOptions.initial())
                .build();
     
        // 数据源
        DataStreamSource<String> source = env.addSource(sourceFunction);
        source.print();
        env.execute("flink cdc");
  • 写回答

0条回答

      报告相同问题?

      相关推荐 更多相似问题

      问题事件

      • 系统已结题 10月4日
      • 创建了问题 9月26日

      悬赏问题

      • ¥15 python qt 实现数据表 表头筛选
      • ¥15 关于电子电气架构的问题,如何解决?
      • ¥75 数据总结公式(克服遗忘问题)
      • ¥15 flask 聊天机器人错误
      • ¥15 Excel数据分析,制作退休计划的电子表格模型
      • ¥15 EasyExcel向模板追加导入数据出现多余空行
      • ¥55 C语言谁能教我下面的代码怎么打
      • ¥15 C/C++程序代码解释
      • ¥15 java 2个list合并,如果id相同的对象则属性合并到一起,不同id的对象也要保留
      • ¥50 刚接触优化算法,在用Python时调用二次规划包cvxopt遇到如下问题