flink org.apache.flink.table.api.NoMatchingTableFactoryException












0















I'm using flink table api, using kafka as input source and json as table schema. I got this error when submit my program:
```
The program finished with the following exception:



org.apache.flink.client.program.ProgramInvocationException: The main method caused an error.
at org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:546)
at org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:421)
at org.apache.flink.client.program.ClusterClient.run(ClusterClient.java:426)
at org.apache.flink.client.cli.CliFrontend.executeProgram(CliFrontend.java:804)
at org.apache.flink.client.cli.CliFrontend.runProgram(CliFrontend.java:280)
at org.apache.flink.client.cli.CliFrontend.run(CliFrontend.java:215)
at org.apache.flink.client.cli.CliFrontend.parseParameters(CliFrontend.java:1044)
at org.apache.flink.client.cli.CliFrontend.lambda$main$11(CliFrontend.java:1120)
at org.apache.flink.runtime.security.NoOpSecurityContext.runSecured(NoOpSecurityContext.java:30)
at org.apache.flink.client.cli.CliFrontend.main(CliFrontend.java:1120)
Caused by: org.apache.flink.table.api.NoMatchingTableFactoryException:

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

Reason: No context matches.

The following properties are requested:
connector.properties.0.key=zookeeper.connect
connector.properties.0.value=localhost:2181
connector.properties.1.key=bootstrap.servers
connector.properties.1.value=localhost:9092
connector.property-version=1
connector.startup-mode=latest-offset
connector.topic=flink_table_test
connector.type=kafka
connector.version=0.10
format.fail-on-missing-field=true
format.json-schema={t'type': 'object',t'properties': {tt'uid': {ttt'type': 'number'tt},tt'name': {ttt'type': 'string'tt},tt'age': {ttt'type': 'number'tt},tt'timestamp': {ttt'type': 'long'tt}t}}
format.property-version=1
format.type=json
schema.0.name=uid
schema.0.type=BIGINT
schema.1.name=name
schema.1.type=VARCHAR
schema.2.name=age
schema.2.type=INT
schema.3.name=ts
schema.3.type=TIMESTAMP
update-mode=append

The following factories have been considered:
org.apache.flink.formats.json.JsonRowFormatFactory
org.apache.flink.table.sources.CsvBatchTableSourceFactory
org.apache.flink.table.sources.CsvAppendTableSourceFactory
org.apache.flink.table.sinks.CsvBatchTableSinkFactory
org.apache.flink.table.sinks.CsvAppendTableSinkFactory

at org.apache.flink.table.factories.TableFactoryService$.filterByContext(TableFactoryService.scala:214)
at org.apache.flink.table.factories.TableFactoryService$.findInternal(TableFactoryService.scala:130)
at org.apache.flink.table.factories.TableFactoryService$.find(TableFactoryService.scala:81)
at org.apache.flink.table.factories.TableFactoryUtil$.findAndCreateTableSource(TableFactoryUtil.scala:49)
at org.apache.flink.table.descriptors.ConnectTableDescriptor.registerTableSource(ConnectTableDescriptor.scala:44)
at com.akulaku.data.flink.QueryTable$.main(QueryTable.scala:53)
at com.akulaku.data.flink.QueryTable.main(QueryTable.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:529)
... 9 more


```



I already add the flink-json-1.6.1.jar into flink lib path.



Could anyone helps?










share|improve this question



























    0















    I'm using flink table api, using kafka as input source and json as table schema. I got this error when submit my program:
    ```
    The program finished with the following exception:



    org.apache.flink.client.program.ProgramInvocationException: The main method caused an error.
    at org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:546)
    at org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:421)
    at org.apache.flink.client.program.ClusterClient.run(ClusterClient.java:426)
    at org.apache.flink.client.cli.CliFrontend.executeProgram(CliFrontend.java:804)
    at org.apache.flink.client.cli.CliFrontend.runProgram(CliFrontend.java:280)
    at org.apache.flink.client.cli.CliFrontend.run(CliFrontend.java:215)
    at org.apache.flink.client.cli.CliFrontend.parseParameters(CliFrontend.java:1044)
    at org.apache.flink.client.cli.CliFrontend.lambda$main$11(CliFrontend.java:1120)
    at org.apache.flink.runtime.security.NoOpSecurityContext.runSecured(NoOpSecurityContext.java:30)
    at org.apache.flink.client.cli.CliFrontend.main(CliFrontend.java:1120)
    Caused by: org.apache.flink.table.api.NoMatchingTableFactoryException:

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

    Reason: No context matches.

    The following properties are requested:
    connector.properties.0.key=zookeeper.connect
    connector.properties.0.value=localhost:2181
    connector.properties.1.key=bootstrap.servers
    connector.properties.1.value=localhost:9092
    connector.property-version=1
    connector.startup-mode=latest-offset
    connector.topic=flink_table_test
    connector.type=kafka
    connector.version=0.10
    format.fail-on-missing-field=true
    format.json-schema={t'type': 'object',t'properties': {tt'uid': {ttt'type': 'number'tt},tt'name': {ttt'type': 'string'tt},tt'age': {ttt'type': 'number'tt},tt'timestamp': {ttt'type': 'long'tt}t}}
    format.property-version=1
    format.type=json
    schema.0.name=uid
    schema.0.type=BIGINT
    schema.1.name=name
    schema.1.type=VARCHAR
    schema.2.name=age
    schema.2.type=INT
    schema.3.name=ts
    schema.3.type=TIMESTAMP
    update-mode=append

    The following factories have been considered:
    org.apache.flink.formats.json.JsonRowFormatFactory
    org.apache.flink.table.sources.CsvBatchTableSourceFactory
    org.apache.flink.table.sources.CsvAppendTableSourceFactory
    org.apache.flink.table.sinks.CsvBatchTableSinkFactory
    org.apache.flink.table.sinks.CsvAppendTableSinkFactory

    at org.apache.flink.table.factories.TableFactoryService$.filterByContext(TableFactoryService.scala:214)
    at org.apache.flink.table.factories.TableFactoryService$.findInternal(TableFactoryService.scala:130)
    at org.apache.flink.table.factories.TableFactoryService$.find(TableFactoryService.scala:81)
    at org.apache.flink.table.factories.TableFactoryUtil$.findAndCreateTableSource(TableFactoryUtil.scala:49)
    at org.apache.flink.table.descriptors.ConnectTableDescriptor.registerTableSource(ConnectTableDescriptor.scala:44)
    at com.akulaku.data.flink.QueryTable$.main(QueryTable.scala:53)
    at com.akulaku.data.flink.QueryTable.main(QueryTable.scala)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:529)
    ... 9 more


    ```



    I already add the flink-json-1.6.1.jar into flink lib path.



    Could anyone helps?










    share|improve this question

























      0












      0








      0








      I'm using flink table api, using kafka as input source and json as table schema. I got this error when submit my program:
      ```
      The program finished with the following exception:



      org.apache.flink.client.program.ProgramInvocationException: The main method caused an error.
      at org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:546)
      at org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:421)
      at org.apache.flink.client.program.ClusterClient.run(ClusterClient.java:426)
      at org.apache.flink.client.cli.CliFrontend.executeProgram(CliFrontend.java:804)
      at org.apache.flink.client.cli.CliFrontend.runProgram(CliFrontend.java:280)
      at org.apache.flink.client.cli.CliFrontend.run(CliFrontend.java:215)
      at org.apache.flink.client.cli.CliFrontend.parseParameters(CliFrontend.java:1044)
      at org.apache.flink.client.cli.CliFrontend.lambda$main$11(CliFrontend.java:1120)
      at org.apache.flink.runtime.security.NoOpSecurityContext.runSecured(NoOpSecurityContext.java:30)
      at org.apache.flink.client.cli.CliFrontend.main(CliFrontend.java:1120)
      Caused by: org.apache.flink.table.api.NoMatchingTableFactoryException:

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

      Reason: No context matches.

      The following properties are requested:
      connector.properties.0.key=zookeeper.connect
      connector.properties.0.value=localhost:2181
      connector.properties.1.key=bootstrap.servers
      connector.properties.1.value=localhost:9092
      connector.property-version=1
      connector.startup-mode=latest-offset
      connector.topic=flink_table_test
      connector.type=kafka
      connector.version=0.10
      format.fail-on-missing-field=true
      format.json-schema={t'type': 'object',t'properties': {tt'uid': {ttt'type': 'number'tt},tt'name': {ttt'type': 'string'tt},tt'age': {ttt'type': 'number'tt},tt'timestamp': {ttt'type': 'long'tt}t}}
      format.property-version=1
      format.type=json
      schema.0.name=uid
      schema.0.type=BIGINT
      schema.1.name=name
      schema.1.type=VARCHAR
      schema.2.name=age
      schema.2.type=INT
      schema.3.name=ts
      schema.3.type=TIMESTAMP
      update-mode=append

      The following factories have been considered:
      org.apache.flink.formats.json.JsonRowFormatFactory
      org.apache.flink.table.sources.CsvBatchTableSourceFactory
      org.apache.flink.table.sources.CsvAppendTableSourceFactory
      org.apache.flink.table.sinks.CsvBatchTableSinkFactory
      org.apache.flink.table.sinks.CsvAppendTableSinkFactory

      at org.apache.flink.table.factories.TableFactoryService$.filterByContext(TableFactoryService.scala:214)
      at org.apache.flink.table.factories.TableFactoryService$.findInternal(TableFactoryService.scala:130)
      at org.apache.flink.table.factories.TableFactoryService$.find(TableFactoryService.scala:81)
      at org.apache.flink.table.factories.TableFactoryUtil$.findAndCreateTableSource(TableFactoryUtil.scala:49)
      at org.apache.flink.table.descriptors.ConnectTableDescriptor.registerTableSource(ConnectTableDescriptor.scala:44)
      at com.akulaku.data.flink.QueryTable$.main(QueryTable.scala:53)
      at com.akulaku.data.flink.QueryTable.main(QueryTable.scala)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:529)
      ... 9 more


      ```



      I already add the flink-json-1.6.1.jar into flink lib path.



      Could anyone helps?










      share|improve this question














      I'm using flink table api, using kafka as input source and json as table schema. I got this error when submit my program:
      ```
      The program finished with the following exception:



      org.apache.flink.client.program.ProgramInvocationException: The main method caused an error.
      at org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:546)
      at org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:421)
      at org.apache.flink.client.program.ClusterClient.run(ClusterClient.java:426)
      at org.apache.flink.client.cli.CliFrontend.executeProgram(CliFrontend.java:804)
      at org.apache.flink.client.cli.CliFrontend.runProgram(CliFrontend.java:280)
      at org.apache.flink.client.cli.CliFrontend.run(CliFrontend.java:215)
      at org.apache.flink.client.cli.CliFrontend.parseParameters(CliFrontend.java:1044)
      at org.apache.flink.client.cli.CliFrontend.lambda$main$11(CliFrontend.java:1120)
      at org.apache.flink.runtime.security.NoOpSecurityContext.runSecured(NoOpSecurityContext.java:30)
      at org.apache.flink.client.cli.CliFrontend.main(CliFrontend.java:1120)
      Caused by: org.apache.flink.table.api.NoMatchingTableFactoryException:

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

      Reason: No context matches.

      The following properties are requested:
      connector.properties.0.key=zookeeper.connect
      connector.properties.0.value=localhost:2181
      connector.properties.1.key=bootstrap.servers
      connector.properties.1.value=localhost:9092
      connector.property-version=1
      connector.startup-mode=latest-offset
      connector.topic=flink_table_test
      connector.type=kafka
      connector.version=0.10
      format.fail-on-missing-field=true
      format.json-schema={t'type': 'object',t'properties': {tt'uid': {ttt'type': 'number'tt},tt'name': {ttt'type': 'string'tt},tt'age': {ttt'type': 'number'tt},tt'timestamp': {ttt'type': 'long'tt}t}}
      format.property-version=1
      format.type=json
      schema.0.name=uid
      schema.0.type=BIGINT
      schema.1.name=name
      schema.1.type=VARCHAR
      schema.2.name=age
      schema.2.type=INT
      schema.3.name=ts
      schema.3.type=TIMESTAMP
      update-mode=append

      The following factories have been considered:
      org.apache.flink.formats.json.JsonRowFormatFactory
      org.apache.flink.table.sources.CsvBatchTableSourceFactory
      org.apache.flink.table.sources.CsvAppendTableSourceFactory
      org.apache.flink.table.sinks.CsvBatchTableSinkFactory
      org.apache.flink.table.sinks.CsvAppendTableSinkFactory

      at org.apache.flink.table.factories.TableFactoryService$.filterByContext(TableFactoryService.scala:214)
      at org.apache.flink.table.factories.TableFactoryService$.findInternal(TableFactoryService.scala:130)
      at org.apache.flink.table.factories.TableFactoryService$.find(TableFactoryService.scala:81)
      at org.apache.flink.table.factories.TableFactoryUtil$.findAndCreateTableSource(TableFactoryUtil.scala:49)
      at org.apache.flink.table.descriptors.ConnectTableDescriptor.registerTableSource(ConnectTableDescriptor.scala:44)
      at com.akulaku.data.flink.QueryTable$.main(QueryTable.scala:53)
      at com.akulaku.data.flink.QueryTable.main(QueryTable.scala)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:529)
      ... 9 more


      ```



      I already add the flink-json-1.6.1.jar into flink lib path.



      Could anyone helps?







      apache-flink






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Oct 24 '18 at 4:15









      LunatictwoLunatictwo

      15811




      15811
























          1 Answer
          1






          active

          oldest

          votes


















          0














          Try adding the kafka connector sql jar (e.g. flink-connector-kafka-0.11_2.11-1.6.1-sql-jar.jar). You can find the whole list of connector dependencies here.






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52961025%2fflink-org-apache-flink-table-api-nomatchingtablefactoryexception%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Try adding the kafka connector sql jar (e.g. flink-connector-kafka-0.11_2.11-1.6.1-sql-jar.jar). You can find the whole list of connector dependencies here.






            share|improve this answer




























              0














              Try adding the kafka connector sql jar (e.g. flink-connector-kafka-0.11_2.11-1.6.1-sql-jar.jar). You can find the whole list of connector dependencies here.






              share|improve this answer


























                0












                0








                0







                Try adding the kafka connector sql jar (e.g. flink-connector-kafka-0.11_2.11-1.6.1-sql-jar.jar). You can find the whole list of connector dependencies here.






                share|improve this answer













                Try adding the kafka connector sql jar (e.g. flink-connector-kafka-0.11_2.11-1.6.1-sql-jar.jar). You can find the whole list of connector dependencies here.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Oct 25 '18 at 8:23









                Dawid WysakowiczDawid Wysakowicz

                2,4581126




                2,4581126
































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f52961025%2fflink-org-apache-flink-table-api-nomatchingtablefactoryexception%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Mossoró

                    Error while reading .h5 file using the rhdf5 package in R

                    Pushsharp Apns notification error: 'InvalidToken'