Debezium Mysql连接器解析器下的IncompatibleClassChangeError

Posted

技术标签:

【中文标题】Debezium Mysql连接器解析器下的IncompatibleClassChangeError【英文标题】:IncompatibleClassChangeError under Debezium Mysql connector Parser 【发布时间】:2020-10-12 04:09:51 【问题描述】:

我有一个 java 应用程序,我在其中使用 Debezium-connector-mysql 依赖项 像这样

    <dependency>
            <groupId>io.debezium</groupId>
            <artifactId>debezium-connector-mysql</artifactId>
            <version>1.2.0.CR2</version>
    </dependency>

当我尝试手动运行我的集成测试时,它正在运行。我没有遇到任何异常,但是当我尝试使用构建项目时


mvn 全新安装


我遇到以下异常,谁能帮我解决这个问题

[2020-06-22 15:30:43,511] INFO [debezium-mysql-source|task-0] Writes to MySQL tables prevented for a total of 00:00:01.185 (io.debezium.connector.mysql.SnapshotReader:777)
[2020-06-22 15:30:43,513] ERROR [debezium-mysql-source|task-0] Failed due to error: Aborting snapshot due to error when last running 'UNLOCK TABLES': io.debezium.ddl.parser.mysql.generated.MySqlParser and io.debezium.ddl.parser.mysql.generated.MySqlParser$StringDataTypeContext disagree on InnerClasses attribute (io.debezium.connector.mysql.SnapshotReader:208)
io.debezium.ddl.parser.mysql.generated.MySqlParser and io.debezium.ddl.parser.mysql.generated.MySqlParser$StringDataTypeContext disagree on InnerClasses attribute
        at io.debezium.connector.mysql.AbstractReader.wrap(AbstractReader.java:230)
        at io.debezium.connector.mysql.AbstractReader.failed(AbstractReader.java:207)
        at io.debezium.connector.mysql.SnapshotReader.execute(SnapshotReader.java:831)
        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.IncompatibleClassChangeError: io.debezium.ddl.parser.mysql.generated.MySqlParser and io.debezium.ddl.parser.mysql.generated.MySqlParser$StringDataTypeContext disagree on InnerClasses attribute
        at java.lang.Class.getDeclaringClass0(Native Method)
        at java.lang.Class.getDeclaringClass(Class.java:1235)
        at java.lang.Class.getEnclosingClass(Class.java:1277)
        at java.lang.Class.getCanonicalName(Class.java:1392)
        at io.debezium.connector.mysql.antlr.MySqlAntlrDdlParser.initializeDataTypeResolver(MySqlAntlrDdlParser.java:100)
        at io.debezium.antlr.AntlrDdlParser.parse(AntlrDdlParser.java:72)
        at io.debezium.connector.mysql.MySqlSchema.applyDdl(MySqlSchema.java:314)
        at io.debezium.connector.mysql.SnapshotReader.execute(SnapshotReader.java:488)
        ... 3 more
[2020-06-22 15:30:43,592] INFO [debezium-mysql-source|task-0] WorkerSourceTaskid=debezium-mysql-source-0 Committing offsets (org.apache.kafka.connect.runtime.WorkerSourceTask:478)

在导入 maven 依赖项时我做错了什么还是别的什么..!

【问题讨论】:

【参考方案1】:

请确保在完全相同的版本中提取所有 Debezium 工件。在这里,您可能有不同版本的 debezium-connector-mysqldebezium-ddl-parser

【讨论】:

没用..!我尝试使用相同版本的 debezium-connector-mysql、debezium-core 和 debezium-ddl-parser 问题仍然存在

以上是关于Debezium Mysql连接器解析器下的IncompatibleClassChangeError的主要内容,如果未能解决你的问题,请参考以下文章

Debezium - 自定义负载 - MySQL 连接器

如何为 mysql 数据库创建多个 Debezium 连接器

如何将新表添加到 Debezium MySQL 连接器?

尝试运行连接器类“io.debezium.connector.mysql.MySqlConnector”时出错

MySQL 的 Debezium 连接器。缺少数据库历史主题

(KAFKA Oracle DEBEZIUM)无法连接:无法解析Oracle数据库版本