0


flink cdc报错

按照官网demo在我线上idea 模块执行任务报错

https://github.com/ververica/flink-cdc-connectors

执行flink cdc 报错,ClassNotFoundException: org.apache.kafka.common.utils.ThreadUtils

引入的依赖如下

    <dependency>
            <groupId>com.ververica</groupId>
            <artifactId>flink-connector-mysql-cdc</artifactId>
            <version>2.3.0</version>
    </dependency>
Caused by: java.lang.NoClassDefFoundError: org/apache/kafka/common/utils/ThreadUtils
    at com.ververica.cdc.debezium.internal.FlinkOffsetBackingStore.start(FlinkOffsetBackingStore.java:150)
    at com.ververica.cdc.debezium.internal.FlinkOffsetBackingStore.configure(FlinkOffsetBackingStore.java:69)
    at io.debezium.embedded.EmbeddedEngine.run(EmbeddedEngine.java:690)
    at io.debezium.embedded.ConvertingEngineBuilder$2.run(ConvertingEngineBuilder.java:188)
    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: org.apache.kafka.common.utils.ThreadUtils
    at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
    ... 7 more

查看pom依赖发现和官网方式引入的kafka jar 不一样

后经过排查 发现是.iml文件内固定是kafka1.0.2的jar

删除iml文件执行仍然报错,后新建module 把代码全部复制到新建的module可以读取数据

标签: flink java 大数据

本文转载自: https://blog.csdn.net/wulianwang1994/article/details/128200131
版权归原作者 iot1994 所有, 如有侵权,请联系我们删除。

“flink cdc报错”的评论:

还没有评论