自定义Connector 报错

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

自定义Connector 报错

superainbower
HI,大家好:
我有一个应用场景,利用Flinksql读取Kafka数据写入Kudu,由于官方没有Kudu Connector,自定义了一个Kudu Sink Connector,在本地IDEA下测试可以 正常跑通;
可是将代码打包,并将kudu-client.jar的依赖包放置Flink的lib目录下之后,提交任务到集群报错如下:


java.lang.NoClassDefFoundError: com/stumbleupon/async/Callback
        at org.apache.kudu.client.AsyncKuduClient$AsyncKuduClientBuilder.build(AsyncKuduClient.java:2525) ~[kudu-client-1.9.0.jar:1.9.0]
        at org.apache.kudu.client.KuduClient$KuduClientBuilder.build(KuduClient.java:533) ~[kudu-client-1.9.0.jar:1.9.0]
        at com.java.flink.sql.kudu.KuduSinkFunction.open(KuduSinkFunction.java:38) ~[FlinkProject.jar:?]
        at org.apache.flink.api.common.functions.util.FunctionUtils.openFunction(FunctionUtils.java:36) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
        at org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator.open(AbstractUdfStreamOperator.java:102) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
        at org.apache.flink.table.runtime.operators.sink.SinkOperator.open(SinkOperator.java:63) ~[flink-table-blink_2.11-1.12.0.jar:1.12.0]
        at org.apache.flink.streaming.runtime.tasks.OperatorChain.initializeStateAndOpenOperators(OperatorChain.java:401) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
        at org.apache.flink.streaming.runtime.tasks.StreamTask.lambda$beforeInvoke$2(StreamTask.java:507) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
        at org.apache.flink.streaming.runtime.tasks.StreamTaskActionExecutor$SynchronizedStreamTaskActionExecutor.runThrowing(StreamTaskActionExecutor.java:92) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
        at org.apache.flink.streaming.runtime.tasks.StreamTask.beforeInvoke(StreamTask.java:501) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
        at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:531) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
        at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:722) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
        at org.apache.flink.runtime.taskmanager.Task.run(Task.java:547) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
        at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_162]
        Suppressed: java.lang.NullPointerException
                at com.java.flink.sql.kudu.KuduSinkFunction.close(KuduSinkFunction.java:86) ~[FlinkProject.jar:?]
                at org.apache.flink.api.common.functions.util.FunctionUtils.closeFunction(FunctionUtils.java:43) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
                at org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator.dispose(AbstractUdfStreamOperator.java:117) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
                at org.apache.flink.streaming.runtime.tasks.StreamTask.disposeAllOperators(StreamTask.java:740) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
                at org.apache.flink.streaming.runtime.tasks.StreamTask.runAndSuppressThrowable(StreamTask.java:720) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
                at org.apache.flink.streaming.runtime.tasks.StreamTask.cleanUpInvoke(StreamTask.java:643) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
                at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:552) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
                at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:722) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
                at org.apache.flink.runtime.taskmanager.Task.run(Task.java:547) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
                at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_162]
Caused by: java.lang.ClassNotFoundException: com.stumbleupon.async.Callback
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_162]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_162]
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338) ~[?:1.8.0_162]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_162]
        ... 14 more


不是很清楚这个 com.stumbleupon.async.Callback 类的依赖来自哪里,该怎么解决?
| |
superainbower
|
|
[hidden email]
|
签名由网易邮箱大师定制

Reply | Threaded
Open this post in threaded view
|

Re:自定义Connector 报错

hailongwang
这个应该是 `kudu-client.jar` 里面应该打进去的吧。
可以看下 jar -tf kudu-client.jar | grep 'com.stumbleupon.async.Callback'
ps: 你的 close 方法有 npe,应该是 客户端还没构建出来,可以判空下。


Best,
Hailong
在 2020-12-30 17:24:48,"superainbower" <[hidden email]> 写道:

>HI,大家好:
>我有一个应用场景,利用Flinksql读取Kafka数据写入Kudu,由于官方没有Kudu Connector,自定义了一个Kudu Sink Connector,在本地IDEA下测试可以 正常跑通;
>可是将代码打包,并将kudu-client.jar的依赖包放置Flink的lib目录下之后,提交任务到集群报错如下:
>
>
>java.lang.NoClassDefFoundError: com/stumbleupon/async/Callback
> at org.apache.kudu.client.AsyncKuduClient$AsyncKuduClientBuilder.build(AsyncKuduClient.java:2525) ~[kudu-client-1.9.0.jar:1.9.0]
> at org.apache.kudu.client.KuduClient$KuduClientBuilder.build(KuduClient.java:533) ~[kudu-client-1.9.0.jar:1.9.0]
> at com.java.flink.sql.kudu.KuduSinkFunction.open(KuduSinkFunction.java:38) ~[FlinkProject.jar:?]
> at org.apache.flink.api.common.functions.util.FunctionUtils.openFunction(FunctionUtils.java:36) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
> at org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator.open(AbstractUdfStreamOperator.java:102) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
> at org.apache.flink.table.runtime.operators.sink.SinkOperator.open(SinkOperator.java:63) ~[flink-table-blink_2.11-1.12.0.jar:1.12.0]
> at org.apache.flink.streaming.runtime.tasks.OperatorChain.initializeStateAndOpenOperators(OperatorChain.java:401) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
> at org.apache.flink.streaming.runtime.tasks.StreamTask.lambda$beforeInvoke$2(StreamTask.java:507) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
> at org.apache.flink.streaming.runtime.tasks.StreamTaskActionExecutor$SynchronizedStreamTaskActionExecutor.runThrowing(StreamTaskActionExecutor.java:92) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
> at org.apache.flink.streaming.runtime.tasks.StreamTask.beforeInvoke(StreamTask.java:501) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
> at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:531) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
> at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:722) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
> at org.apache.flink.runtime.taskmanager.Task.run(Task.java:547) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
> at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_162]
> Suppressed: java.lang.NullPointerException
> at com.java.flink.sql.kudu.KuduSinkFunction.close(KuduSinkFunction.java:86) ~[FlinkProject.jar:?]
> at org.apache.flink.api.common.functions.util.FunctionUtils.closeFunction(FunctionUtils.java:43) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
> at org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator.dispose(AbstractUdfStreamOperator.java:117) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
> at org.apache.flink.streaming.runtime.tasks.StreamTask.disposeAllOperators(StreamTask.java:740) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
> at org.apache.flink.streaming.runtime.tasks.StreamTask.runAndSuppressThrowable(StreamTask.java:720) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
> at org.apache.flink.streaming.runtime.tasks.StreamTask.cleanUpInvoke(StreamTask.java:643) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
> at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:552) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
> at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:722) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
> at org.apache.flink.runtime.taskmanager.Task.run(Task.java:547) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
> at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_162]
>Caused by: java.lang.ClassNotFoundException: com.stumbleupon.async.Callback
> at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_162]
> at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_162]
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338) ~[?:1.8.0_162]
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_162]
> ... 14 more
>
>
>不是很清楚这个 com.stumbleupon.async.Callback 类的依赖来自哪里,该怎么解决?
>| |
>superainbower
>|
>|
>[hidden email]
>|
>签名由网易邮箱大师定制
>






 
Reply | Threaded
Open this post in threaded view
|

回复:自定义Connector 报错

superainbower
hi,
1.在kudu-client.jar里,按你的方式grep不到,本地idea下启动只引入了 这一个依赖,是可以运行,所以将这个kudu-client的依赖直接放到了lib下,难道还要引入其他依赖吗?
2.你说的对,close是可判空一下

在2020年12月30日 18:33,hailongwang 写道:
这个应该是 `kudu-client.jar` 里面应该打进去的吧。
可以看下 jar -tf kudu-client.jar | grep 'com.stumbleupon.async.Callback'
ps: 你的 close 方法有 npe,应该是 客户端还没构建出来,可以判空下。


Best,
Hailong
在 2020-12-30 17:24:48,"superainbower" <[hidden email]> 写道:

>HI,大家好:
>我有一个应用场景,利用Flinksql读取Kafka数据写入Kudu,由于官方没有Kudu Connector,自定义了一个Kudu Sink Connector,在本地IDEA下测试可以 正常跑通;
>可是将代码打包,并将kudu-client.jar的依赖包放置Flink的lib目录下之后,提交任务到集群报错如下:
>
>
>java.lang.NoClassDefFoundError: com/stumbleupon/async/Callback
>    at org.apache.kudu.client.AsyncKuduClient$AsyncKuduClientBuilder.build(AsyncKuduClient.java:2525) ~[kudu-client-1.9.0.jar:1.9.0]
>    at org.apache.kudu.client.KuduClient$KuduClientBuilder.build(KuduClient.java:533) ~[kudu-client-1.9.0.jar:1.9.0]
>    at com.java.flink.sql.kudu.KuduSinkFunction.open(KuduSinkFunction.java:38) ~[FlinkProject.jar:?]
>    at org.apache.flink.api.common.functions.util.FunctionUtils.openFunction(FunctionUtils.java:36) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>    at org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator.open(AbstractUdfStreamOperator.java:102) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>    at org.apache.flink.table.runtime.operators.sink.SinkOperator.open(SinkOperator.java:63) ~[flink-table-blink_2.11-1.12.0.jar:1.12.0]
>    at org.apache.flink.streaming.runtime.tasks.OperatorChain.initializeStateAndOpenOperators(OperatorChain.java:401) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>    at org.apache.flink.streaming.runtime.tasks.StreamTask.lambda$beforeInvoke$2(StreamTask.java:507) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>    at org.apache.flink.streaming.runtime.tasks.StreamTaskActionExecutor$SynchronizedStreamTaskActionExecutor.runThrowing(StreamTaskActionExecutor.java:92) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>    at org.apache.flink.streaming.runtime.tasks.StreamTask.beforeInvoke(StreamTask.java:501) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>    at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:531) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>    at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:722) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>    at org.apache.flink.runtime.taskmanager.Task.run(Task.java:547) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>    at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_162]
>    Suppressed: java.lang.NullPointerException
>        at com.java.flink.sql.kudu.KuduSinkFunction.close(KuduSinkFunction.java:86) ~[FlinkProject.jar:?]
>        at org.apache.flink.api.common.functions.util.FunctionUtils.closeFunction(FunctionUtils.java:43) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>        at org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator.dispose(AbstractUdfStreamOperator.java:117) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>        at org.apache.flink.streaming.runtime.tasks.StreamTask.disposeAllOperators(StreamTask.java:740) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>        at org.apache.flink.streaming.runtime.tasks.StreamTask.runAndSuppressThrowable(StreamTask.java:720) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>        at org.apache.flink.streaming.runtime.tasks.StreamTask.cleanUpInvoke(StreamTask.java:643) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>        at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:552) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>        at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:722) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>        at org.apache.flink.runtime.taskmanager.Task.run(Task.java:547) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>        at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_162]
>Caused by: java.lang.ClassNotFoundException: com.stumbleupon.async.Callback
>    at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_162]
>    at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_162]
>    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338) ~[?:1.8.0_162]
>    at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_162]
>    ... 14 more
>
>
>不是很清楚这个 com.stumbleupon.async.Callback 类的依赖来自哪里,该怎么解决?
>| |
>superainbower
>|
>|
>[hidden email]
>|
>签名由网易邮箱大师定制
>






Reply | Threaded
Open this post in threaded view
|

回复:自定义Connector 报错

superainbower
补充一下,在git上Cloudera/kudu 下的 org.apache.kudu.client.AsyncKuduClient这个类里面,确实看到 import com.stumbleupon.async.Callback
应该就是kudu需要引入的,很奇怪已经将整个client的jar 放到lib里面了,怎么还会缺少呢
| |
superainbower
|
|
[hidden email]
|
签名由网易邮箱大师定制


在2020年12月30日 18:59,superainbower<[hidden email]> 写道:
hi,
1.在kudu-client.jar里,按你的方式grep不到,本地idea下启动只引入了 这一个依赖,是可以运行,所以将这个kudu-client的依赖直接放到了lib下,难道还要引入其他依赖吗?
2.你说的对,close是可判空一下

在2020年12月30日 18:33,hailongwang 写道:
这个应该是 `kudu-client.jar` 里面应该打进去的吧。
可以看下 jar -tf kudu-client.jar | grep 'com.stumbleupon.async.Callback'
ps: 你的 close 方法有 npe,应该是 客户端还没构建出来,可以判空下。


Best,
Hailong
在 2020-12-30 17:24:48,"superainbower" <[hidden email]> 写道:

>HI,大家好:
>我有一个应用场景,利用Flinksql读取Kafka数据写入Kudu,由于官方没有Kudu Connector,自定义了一个Kudu Sink Connector,在本地IDEA下测试可以 正常跑通;
>可是将代码打包,并将kudu-client.jar的依赖包放置Flink的lib目录下之后,提交任务到集群报错如下:
>
>
>java.lang.NoClassDefFoundError: com/stumbleupon/async/Callback
>    at org.apache.kudu.client.AsyncKuduClient$AsyncKuduClientBuilder.build(AsyncKuduClient.java:2525) ~[kudu-client-1.9.0.jar:1.9.0]
>    at org.apache.kudu.client.KuduClient$KuduClientBuilder.build(KuduClient.java:533) ~[kudu-client-1.9.0.jar:1.9.0]
>    at com.java.flink.sql.kudu.KuduSinkFunction.open(KuduSinkFunction.java:38) ~[FlinkProject.jar:?]
>    at org.apache.flink.api.common.functions.util.FunctionUtils.openFunction(FunctionUtils.java:36) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>    at org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator.open(AbstractUdfStreamOperator.java:102) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>    at org.apache.flink.table.runtime.operators.sink.SinkOperator.open(SinkOperator.java:63) ~[flink-table-blink_2.11-1.12.0.jar:1.12.0]
>    at org.apache.flink.streaming.runtime.tasks.OperatorChain.initializeStateAndOpenOperators(OperatorChain.java:401) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>    at org.apache.flink.streaming.runtime.tasks.StreamTask.lambda$beforeInvoke$2(StreamTask.java:507) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>    at org.apache.flink.streaming.runtime.tasks.StreamTaskActionExecutor$SynchronizedStreamTaskActionExecutor.runThrowing(StreamTaskActionExecutor.java:92) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>    at org.apache.flink.streaming.runtime.tasks.StreamTask.beforeInvoke(StreamTask.java:501) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>    at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:531) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>    at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:722) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>    at org.apache.flink.runtime.taskmanager.Task.run(Task.java:547) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>    at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_162]
>    Suppressed: java.lang.NullPointerException
>        at com.java.flink.sql.kudu.KuduSinkFunction.close(KuduSinkFunction.java:86) ~[FlinkProject.jar:?]
>        at org.apache.flink.api.common.functions.util.FunctionUtils.closeFunction(FunctionUtils.java:43) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>        at org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator.dispose(AbstractUdfStreamOperator.java:117) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>        at org.apache.flink.streaming.runtime.tasks.StreamTask.disposeAllOperators(StreamTask.java:740) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>        at org.apache.flink.streaming.runtime.tasks.StreamTask.runAndSuppressThrowable(StreamTask.java:720) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>        at org.apache.flink.streaming.runtime.tasks.StreamTask.cleanUpInvoke(StreamTask.java:643) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>        at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:552) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>        at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:722) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>        at org.apache.flink.runtime.taskmanager.Task.run(Task.java:547) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
>        at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_162]
>Caused by: java.lang.ClassNotFoundException: com.stumbleupon.async.Callback
>    at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_162]
>    at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_162]
>    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338) ~[?:1.8.0_162]
>    at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_162]
>    ... 14 more
>
>
>不是很清楚这个 com.stumbleupon.async.Callback 类的依赖来自哪里,该怎么解决?
>| |
>superainbower
>|
>|
>[hidden email]
>|
>签名由网易邮箱大师定制
>






Reply | Threaded
Open this post in threaded view
|

回复:自定义Connector 报错

superainbower
接着补充一下,在git上Cloudera/kudu 的pom文件里发现
<dependencies>
        <dependency>
            <!-- Not shaded or included in the client JAR because it's part
                 of the public API. -->
            <groupId>com.stumbleupon</groupId>
            <artifactId>async</artifactId>
            <version>${async.version}</version>
            <exclusions>
                <!-- Explicitly exclude slf4j because async uses version ranges
                     for the dependency -->
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>


Not shaded or included in the client JAR because it's part of the public API,这应该就是Flink集群里不包含这个pulbic API 导致这个报错


| |
superainbower
|
|
[hidden email]
|
签名由网易邮箱大师定制


在2020年12月30日 19:16,superainbower<[hidden email]> 写道:
补充一下,在git上Cloudera/kudu 下的 org.apache.kudu.client.AsyncKuduClient这个类里面,确实看到 import com.stumbleupon.async.Callback
应该就是kudu需要引入的,很奇怪已经将整个client的jar 放到lib里面了,怎么还会缺少呢
| |
superainbower
|
|
[hidden email]
|
签名由网易邮箱大师定制


在2020年12月30日 18:59,superainbower<[hidden email]> 写道:
hi,
1.在kudu-client.jar里,按你的方式grep不到,本地idea下启动只引入了 这一个依赖,是可以运行,所以将这个kudu-client的依赖直接放到了lib下,难道还要引入其他依赖吗?
2.你说的对,close是可判空一下

在2020年12月30日 18:33,hailongwang 写道:
这个应该是 `kudu-client.jar` 里面应该打进去的吧。
可以看下 jar -tf kudu-client.jar | grep 'com.stumbleupon.async.Callback'
ps: 你的 close 方法有 npe,应该是 客户端还没构建出来,可以判空下。


Best,
Hailong
在 2020-12-30 17:24:48,"superainbower" <[hidden email]> 写道:
HI,大家好:
我有一个应用场景,利用Flinksql读取Kafka数据写入Kudu,由于官方没有Kudu Connector,自定义了一个Kudu Sink Connector,在本地IDEA下测试可以 正常跑通;
可是将代码打包,并将kudu-client.jar的依赖包放置Flink的lib目录下之后,提交任务到集群报错如下:


java.lang.NoClassDefFoundError: com/stumbleupon/async/Callback
at org.apache.kudu.client.AsyncKuduClient$AsyncKuduClientBuilder.build(AsyncKuduClient.java:2525) ~[kudu-client-1.9.0.jar:1.9.0]
at org.apache.kudu.client.KuduClient$KuduClientBuilder.build(KuduClient.java:533) ~[kudu-client-1.9.0.jar:1.9.0]
at com.java.flink.sql.kudu.KuduSinkFunction.open(KuduSinkFunction.java:38) ~[FlinkProject.jar:?]
at org.apache.flink.api.common.functions.util.FunctionUtils.openFunction(FunctionUtils.java:36) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
at org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator.open(AbstractUdfStreamOperator.java:102) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
at org.apache.flink.table.runtime.operators.sink.SinkOperator.open(SinkOperator.java:63) ~[flink-table-blink_2.11-1.12.0.jar:1.12.0]
at org.apache.flink.streaming.runtime.tasks.OperatorChain.initializeStateAndOpenOperators(OperatorChain.java:401) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
at org.apache.flink.streaming.runtime.tasks.StreamTask.lambda$beforeInvoke$2(StreamTask.java:507) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
at org.apache.flink.streaming.runtime.tasks.StreamTaskActionExecutor$SynchronizedStreamTaskActionExecutor.runThrowing(StreamTaskActionExecutor.java:92) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
at org.apache.flink.streaming.runtime.tasks.StreamTask.beforeInvoke(StreamTask.java:501) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:531) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:722) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:547) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_162]
Suppressed: java.lang.NullPointerException
at com.java.flink.sql.kudu.KuduSinkFunction.close(KuduSinkFunction.java:86) ~[FlinkProject.jar:?]
at org.apache.flink.api.common.functions.util.FunctionUtils.closeFunction(FunctionUtils.java:43) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
at org.apache.flink.streaming.api.operators.AbstractUdfStreamOperator.dispose(AbstractUdfStreamOperator.java:117) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
at org.apache.flink.streaming.runtime.tasks.StreamTask.disposeAllOperators(StreamTask.java:740) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
at org.apache.flink.streaming.runtime.tasks.StreamTask.runAndSuppressThrowable(StreamTask.java:720) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
at org.apache.flink.streaming.runtime.tasks.StreamTask.cleanUpInvoke(StreamTask.java:643) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
at org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:552) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:722) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
at org.apache.flink.runtime.taskmanager.Task.run(Task.java:547) ~[flink-dist_2.11-1.12.0.jar:1.12.0]
at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_162]
Caused by: java.lang.ClassNotFoundException: com.stumbleupon.async.Callback
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[?:1.8.0_162]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_162]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338) ~[?:1.8.0_162]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_162]
... 14 more


不是很清楚这个 com.stumbleupon.async.Callback 类的依赖来自哪里,该怎么解决?
| |
superainbower
|
|
[hidden email]
|
签名由网易邮箱大师定制