apache / flink-cdc

Flink CDC is a streaming data integration tool
https://nightlies.apache.org/flink/flink-cdc-docs-stable
Apache License 2.0
5.72k stars 1.95k forks source link

Flink Sql Mongo 使用的版本是2.1.1 执行同步mongo数据 ,控制台报错: java.lang.ClassCastException: com.ververica.cdc.connectors.mongodb.internal.MongoDBConnectorSourceConnector cannot be cast to com.ververica.cdc.connectors.shaded.org.apache.kafka.connect.source.SourceConnector at io.debezium.embedded.EmbeddedEngine.run(EmbeddedEngine.java:668) [flink-sql-connector-mysql-cdc-2.1.1.jar:2.1.1] at io.debezium.embedded.ConvertingEngineBuilder$2.run(ConvertingEngineBuilder.java:188) [flink-sql-connector-mysql-cdc-2.1.1.jar:2.1.1] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_281] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_281] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_281] #797

Closed zuoshoudao closed 2 years ago

zuoshoudao commented 2 years ago

Describe the bug A clear and concise description of what the bug is.

Environment :

To Reproduce Steps to reproduce the behavior:

  1. Thes test data :
  2. The test code :
  3. The error :

Additional Description If applicable, add screenshots to help explain your problem.

zuoshoudao commented 2 years ago

java.lang.ClassCastException: com.ververica.cdc.connectors.mongodb.internal.MongoDBConnectorSourceConnector cannot be cast to com.ververica.cdc.connectors.shaded.org.apache.kafka.connect.source.SourceConnector at io.debezium.embedded.EmbeddedEngine.run(EmbeddedEngine.java:668) [flink-sql-connector-mysql-cdc-2.1.1.jar:2.1.1] at io.debezium.embedded.ConvertingEngineBuilder$2.run(ConvertingEngineBuilder.java:188) [flink-sql-connector-mysql-cdc-2.1.1.jar:2.1.1]

依赖:
    <dependency>
        <groupId>org.apache.flink</groupId>
        <artifactId>flink-connector-kafka_${scala.binary.version}</artifactId>
        <version>${flink.version}</version>
    </dependency>

    <dependency>
        <groupId>org.apache.flink</groupId>
        <artifactId>flink-table-planner-blink_${scala.binary.version}</artifactId>
        <version>${flink.version}</version>
    </dependency>
    <dependency>
        <groupId>com.ververica</groupId>
        <artifactId>flink-sql-connector-mysql-cdc</artifactId>
        <version>${flink-cdc.version}</version>
    </dependency>
    <dependency>
        <groupId>com.ververica</groupId>
        <artifactId>flink-connector-mongodb-cdc</artifactId>
        <version>${flink-cdc.version}</version>
    </dependency>

    <dependency>
        <groupId>org.apache</groupId>
        <artifactId>doris-flink</artifactId>
        <version>1.0-SNAPSHOT</version>
    </dependency>
2.1.1
zuoshoudao commented 2 years ago

问题找到了,依赖中有flink cdc mysql所以才会报错

QuintinLuke commented 2 months ago

问题找到了,依赖中有flink cdc mysql所以才会报错

不能有其他的cdc?