weixin_39631350
weixin_39631350
2020-12-02 10:14

org.apache.flink.table.api.NoMatchingTableFactoryException: Could not find a suitable table factory

Exception in thread "main" org.apache.flink.table.api.ValidationException: SQL validation failed. findAndCreateTableSource failed. at org.apache.flink.table.planner.calcite.FlinkPlannerImpl.validate(FlinkPlannerImpl.scala:125) at org.apache.flink.table.planner.operations.SqlToOperationConverter.convert(SqlToOperationConverter.java:82) at org.apache.flink.table.planner.operations.SqlToOperationConverter.convertSqlInsert(SqlToOperationConverter.java:154) at org.apache.flink.table.planner.operations.SqlToOperationConverter.convert(SqlToOperationConverter.java:89) at org.apache.flink.table.planner.delegation.PlannerBase.parse(PlannerBase.scala:130) at org.apache.flink.table.api.internal.TableEnvironmentImpl.sqlUpdate(TableEnvironmentImpl.java:335) at com.github.wuchong.sqlsubmit.SqlSubmit.callInsertInto(SqlSubmit.java:102) at com.github.wuchong.sqlsubmit.SqlSubmit.callCommand(SqlSubmit.java:77) at com.github.wuchong.sqlsubmit.SqlSubmit.run(SqlSubmit.java:61) at com.github.wuchong.sqlsubmit.SqlSubmit.main(SqlSubmit.java:38) Caused by: org.apache.flink.table.api.TableException: findAndCreateTableSource failed. at org.apache.flink.table.factories.TableFactoryUtil.findAndCreateTableSource(TableFactoryUtil.java:67) 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.

Reason: No context matches.

该提问来源于开源项目:wuchong/flink-sql-submit

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

11条回答

  • weixin_40278610 麻辣GIS 1月前

    遇到了相同的问题 但是'connector.version' = 'universal',请问怎么解决啊

    点赞 评论 复制链接分享
  • weixin_39631350 weixin_39631350 4月前

    多谢楼上各位啦! 其实什么都不缺。。。。。。。。。 只是我改了一个配置: /resources/q1里面的关于kafka版本的配置 本来是'connector.version' = 'universal', 我改成了'connector.version' = '2.11', 其实这个不用改。 再次谢谢各位啦!

    点赞 评论 复制链接分享
  • weixin_39631350 weixin_39631350 4月前

    多谢楼上各位啦! 其实什么都不缺。。。。。。。。。 只是我改了一个配置: /resources/q1里面的关于kafka版本的配置 本来是'connector.version' = 'universal', 我改成了'connector.version' = '2.11', 其实这个不用改。 再次谢谢各位啦!

    点赞 评论 复制链接分享
  • weixin_39707168 weixin_39707168 4月前

    缺了这俩依赖 <dependency> <groupId>org.apache.flink</groupId> <artifactId>flink-json</artifactId> <version>${flink.version}</version> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.39</version> </dependency>

    点赞 评论 复制链接分享
  • weixin_39887715 weixin_39887715 4月前

    create table 语法写的是不是少东西呢

    点赞 评论 复制链接分享
  • weixin_39887715 weixin_39887715 4月前

    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.

    Reason: No context matches. 会不会是因为jar有重复的

    点赞 评论 复制链接分享
  • weixin_39631350 weixin_39631350 4月前

    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.

    Reason: No context matches. 会不会是因为jar有重复的

    点赞 评论 复制链接分享
  • weixin_39631350 weixin_39631350 4月前

    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.

    Reason: No context matches. 会不会是因为jar有重复的

    点赞 评论 复制链接分享
  • weixin_39631350 weixin_39631350 4月前

    试了一下还是这个错误,好像并没有什么用: The following factories have been considered: org.apache.flink.table.catalog.GenericInMemoryCatalogFactory org.apache.flink.table.planner.delegation.BlinkPlannerFactory org.apache.flink.table.planner.delegation.BlinkExecutorFactory org.apache.flink.table.sources.CsvBatchTableSourceFactory org.apache.flink.table.sources.CsvAppendTableSourceFactory org.apache.flink.table.sinks.CsvBatchTableSinkFactory org.apache.flink.table.sinks.CsvAppendTableSinkFactory org.apache.flink.table.planner.StreamPlannerFactory org.apache.flink.table.executor.StreamExecutorFactory org.apache.flink.api.java.io.jdbc.JDBCTableSourceSinkFactory org.apache.flink.streaming.connectors.kafka.KafkaTableSourceSinkFactory org.apache.flink.formats.json.JsonRowFormatFactory at org.apache.flink.table.factories.TableFactoryService.filterByContext(TableFactoryService.java:283) at org.apache.flink.table.factories.TableFactoryService.filter(TableFactoryService.java:191) at org.apache.flink.table.factories.TableFactoryService.findSingleInternal(TableFactoryService.java:144) at org.apache.flink.table.factories.TableFactoryService.find(TableFactoryService.java:97) at org.apache.flink.table.factories.TableFactoryUtil.findAndCreateTableSource(TableFactoryUtil.java:64) ... 33 more

    我是windows系统本地运行出现这个问题,,,在服务器上运行也是这个问题

    点赞 评论 复制链接分享
  • weixin_39645003 weixin_39645003 4月前

    cep

    引用

    
        <!-- https://mvnrepository.com/artifact/org.apache.flink/flink-connector-kafka -->
      <dependency>
          <groupid>org.apache.flink</groupid>
          <artifactid>flink-connector-kafka_2.12</artifactid>
          <version>1.9.0</version>
      </dependency>
    <p><!-- https://mvnrepository.com/artifact/org.apache.flink/flink-json -->
      <dependency>
          <groupid>org.apache.flink</groupid>
          <artifactid>flink-json</artifactid>
          <version>1.9.0</version>
      </dependency></p>
    <p><dependency>
        <groupid>org.apache.flink</groupid>
        <artifactid>flink-cep_2.11</artifactid>
        <version>1.9.0</version>
      </dependency></p>
    <p><dependency>
              <groupid>mysql</groupid>
              <artifactid>mysql-connector-java</artifactid>
              <version>5.1.34</version>
      </dependency>
    </p>

    flink-cep_2.11 其中用到了cep 表达式才引用

    点赞 评论 复制链接分享
  • weixin_39645003 weixin_39645003 4月前

    引用

        <!-- https://mvnrepository.com/artifact/org.apache.flink/flink-connector-kafka -->
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-connector-kafka_2.12</artifactId>
            <version>1.9.0</version>
        </dependency>
    
        <!-- https://mvnrepository.com/artifact/org.apache.flink/flink-json -->
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-json</artifactId>
            <version>1.9.0</version>
        </dependency>
    
        <dependency>
          <groupId>org.apache.flink</groupId>
          <artifactId>flink-cep_2.11</artifactId>
          <version>1.9.0</version>
        </dependency>
    
        <dependency>
                <groupId>mysql</groupId>
                <artifactId>mysql-connector-java</artifactId>
                <version>5.1.34</version>
        </dependency>
    
    点赞 评论 复制链接分享

为你推荐