创建BatchTableEnvironment报错

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

创建BatchTableEnvironment报错

hl9902@126.com
flink 1.11.2版本,我写了个WordCountTable例子,代码如下:
public class WordCountTable {
    public static void main(String[] args) throws Exception {
        ExecutionEnvironment env = ExecutionEnvironment.getExecutionEnvironment();
        BatchTableEnvironment tEnv = BatchTableEnvironment.create(env);
        DataSet<WordCountTable.WC> input = env.fromElements(new WC("Hello", 1L),。。。。
运行报错:
Exception in thread "main" org.apache.flink.table.api.TableException: Create BatchTableEnvironment failed.
at org.apache.flink.table.api.bridge.java.BatchTableEnvironment.create(BatchTableEnvironment.java:517)
at org.apache.flink.table.api.bridge.java.BatchTableEnvironment.create(BatchTableEnvironment.java:471)
at com.toonyoo.table.WordCountTable.main(WordCountTable.java:12)
Caused by: java.lang.ClassNotFoundException: org.apache.flink.table.api.bridge.java.internal.BatchTableEnvironmentImpl
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

pox table相关依赖:
<!-- table API-->
<dependency>
    <groupId>org.apache.flink</groupId>
    <artifactId>flink-table-api-java-bridge_2.11</artifactId>
    <version>${flink.version}</version>
    <scope>provided</scope>
</dependency>


[hidden email]