编程知识 cdmana.com

Flink DDL的java代碼中的DeserializationSchemaFactory與TableSourceFactory報錯解決方案記錄彙總

下面的刪除線表示不在pom.xml中出現

否則就在pom.xml中出現。

 情況 pom.xml kafka版本設置 對應的報錯

flink-connector-kafka_2.12

flink-connector-kafka-0.11_2.12

flink-json

0.11/universal

Caused by: org.apache.flink.table.api.NoMatchingTableFactoryException:

Could not find a suitable table factory for 'org.apache.flink.table.factories.TableSourceFactory' in
the classpath.

flink-connector-kafka_2.12

flink-connector-kafka-0.11_2.12

flink-json

universal Caused by: org.apache.flink.table.api.NoMatchingTableFactoryException: Could not find a suitable table factory for 'org.apache.flink.table.factories.TableSourceFactory' in
the classpath.

flink-connector-kafka_2.12

flink-connector-kafka-0.11_2.12

flink-json

0.11

Caused by: java.lang.NoSuchMethodError: org.apache.flink.table.utils.TableSchemaUtils.checkNoGeneratedColumns

(Lorg/apache/flink/table/api/TableSchema;)Lorg/apache/flink/table/api/TableSchema;

flink-connector-kafka-0.11_2.12

flink-json

0.11 Reason: No factory implements 'org.apache.flink.table.factories.DeserializationSchemaFactory'.

flink-connector-kafka-0.11_2.12

flink-json

universal Caused by: org.apache.flink.table.api.NoMatchingTableFactoryException: Could not find a suitable table factory for 'org.apache.flink.table.factories.TableSourceFactory' in
the classpath.

flink-connector-kafka_2.12

flink-json

0.11 Caused by: org.apache.flink.table.api.NoMatchingTableFactoryException: Could not find a suitable table factory for 'org.apache.flink.table.factories.TableSourceFactory' in
the classpath.

flink-connector-kafka_2.12

flink-json

universal 無報錯

 

最終bug free的依賴配置(kafka版本設置爲universal)

<dependency>
    <groupId>org.apache.flink</groupId>
    <artifactId>flink-connector-kafka_2.12</artifactId>
    <version>1.12.0</version>
</dependency>



<dependency>
    <groupId>org.apache.flink</groupId>
    <artifactId>flink-json</artifactId>
    <version>1.12.0</version>
    <!--<scope>test</scope>-->
</dependency>

Reference:

[1]flink连接到外部系统Kafka Connector API 代码报错问题org.apache.flink.table.factories.DeserializationSchemaFactory

版权声明
本文为[Applied Sciences]所创,转载请带上原文链接,感谢
https://yuchi.blog.csdn.net/article/details/111656102

Scroll to Top