开发者社区> 问答> 正文

Flink CDC 2.2.1版本按官网Demo运行报错

Jar包依赖: <flink.version>1.13.6</flink.version> <flink.sdk.version>1.0.7-SNAPSHOT</flink.sdk.version> <connector.jmq>1.4-SNAPSHOT</connector.jmq> <flink.cdc.version>2.2.1</flink.cdc.version> <debezium.version>1.5.4.Final</debezium.version> <flink-connector-jdbc.version>1.12.0</flink-connector-jdbc.version>

主程序见下图:

image.png

全量数据可以正常输出,增量数据报错。

image.png

报错如下:

java.lang.RuntimeException: One or more fetchers have encountered exception at org.apache.flink.connector.base.source.reader.fetcher.SplitFetcherManager.checkErrors(SplitFetcherManager.java:223) at org.apache.flink.connector.base.source.reader.SourceReaderBase.getNextFetch(SourceReaderBase.java:154) at org.apache.flink.connector.base.source.reader.SourceReaderBase.pollNext(SourceReaderBase.java:116) at org.apache.flink.streaming.api.operators.SourceOperator.emitNext(SourceOperator.java:305) at org.apache.flink.streaming.runtime.io.StreamTaskSourceInput.emitNext(StreamTaskSourceInput.java:69) at org.apache.flink.streaming.runtime.io.StreamOneInputProcessor.processInput(StreamOneInputProcessor.java:66) at org.apache.flink.streaming.runtime.tasks.StreamTask.processInput(StreamTask.java:423) at org.apache.flink.streaming.runtime.tasks.mailbox.MailboxProcessor.runMailboxLoop(MailboxProcessor.java:204) at org.apache.flink.streaming.runtime.tasks.StreamTask.runMailboxLoop(StreamTask.java:684) at org.apache.flink.streaming.runtime.tasks.StreamTask.executeInvoke(StreamTask.java:639) at org.apache.flink.streaming.runtime.tasks.StreamTask.runWithCleanUpOnFail(StreamTask.java:650) at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:623) at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:779) at org.apache.flink.runtime.taskmanager.Task.run(Task.java:566) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.NoClassDefFoundError: Could not initialize class io.debezium.connector.mysql.MySqlStreamingChangeEventSource$3 at io.debezium.connector.mysql.MySqlStreamingChangeEventSource.sslModeFor(MySqlStreamingChangeEventSource.java:782) at io.debezium.connector.mysql.MySqlStreamingChangeEventSource. (MySqlStreamingChangeEventSource.java:207) at com.ververica.cdc.connectors.mysql.debezium.task.MySqlBinlogSplitReadTask. (MySqlBinlogSplitReadTask.java:68) at com.ververica.cdc.connectors.mysql.debezium.reader.BinlogSplitReader.submitSplit(BinlogSplitReader.java:109) at com.ververica.cdc.connectors.mysql.debezium.reader.BinlogSplitReader.submitSplit(BinlogSplitReader.java:65) at com.ververica.cdc.connectors.mysql.source.reader.MySqlSplitReader.checkSplitOrStartNext(MySqlSplitReader.java:163) at com.ververica.cdc.connectors.mysql.source.reader.MySqlSplitReader.fetch(MySqlSplitReader.java:73) at org.apache.flink.connector.base.source.reader.fetcher.FetchTask.run(FetchTask.java:56) at org.apache.flink.connector.base.source.reader.fetcher.SplitFetcher.runOnce(SplitFetcher.java:140) at org.apache.flink.connector.base.source.reader.fetcher.SplitFetcher.run(SplitFetcher.java:103) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) at java.util.concurrent.FutureTask.run(FutureTask.java) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ... 1 more

Flink UI 如下:

image.png

求大神指点。我跟踪断点,到这个switch。

image.png

下一步就到finally了。

image.png

image.png

展开
收起
1699029687116892 2022-07-25 21:36:29 1392 0
1 条回答
写回答
取消 提交回答
  • image.png 经过一天的排查,发现是MySqlStreamingChangeEventSource类里引入了slf4j的org.slf4j.event.Level类,本地引入的版本是1.7.5,jar包里没有该类导致的报NoClassDefFoundError异常。。。

    2022-07-26 20:33:09
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Flink CDC Meetup PPT - 龚中强 立即下载
Flink CDC Meetup PPT - 王赫 立即下载
Flink CDC Meetup PPT - 覃立辉 立即下载