apache / incubator-streampark

Make stream processing easier! Easy-to-use streaming application development framework and operation platform.
https://streampark.apache.org/
Apache License 2.0
3.91k stars 1.01k forks source link

[Bug] v2.1.1 创建 Flink-Jar 作业,运行在 Standalone 模式下,无法启动作业! #2835

Closed adu-shzz closed 1 year ago

adu-shzz commented 1 year ago

Search before asking

Java Version

Java 1.8

Scala Version

2.12.x

StreamPark Version

v2.1.1

Flink Version

v1.16.0

deploy mode

remote

What happened

当创建完一个 Standalone 模式的 Flink-Jar 作业并发布成功之后,启动作业时失败,具体失败信息进下文。 从异常来看,是 Jar 依赖冲突问题。 我自己的 Flink-Jar 检查之后,没发现有异常中的对应类。然后我用 Flink 官方的 WordCount.jar 创建了一个相同模式的 Flink-Jar 作业,启动时也是报相同的异常。

Error Exception

java.util.concurrent.CompletionException: java.lang.reflect.InvocationTargetException
    at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
    at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
    at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1606)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:750)
Caused by: java.lang.reflect.InvocationTargetException
    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.streampark.flink.client.FlinkClient$.$anonfun$proxy$1(FlinkClient.scala:80)
    at org.apache.streampark.flink.proxy.FlinkShimsProxy$.$anonfun$proxy$1(FlinkShimsProxy.scala:60)
    at org.apache.streampark.common.util.ClassLoaderUtils$.runAsClassLoader(ClassLoaderUtils.scala:38)
    at org.apache.streampark.flink.proxy.FlinkShimsProxy$.proxy(FlinkShimsProxy.scala:60)
    at org.apache.streampark.flink.client.FlinkClient$.proxy(FlinkClient.scala:75)
    at org.apache.streampark.flink.client.FlinkClient$.submit(FlinkClient.scala:49)
    at org.apache.streampark.flink.client.FlinkClient.submit(FlinkClient.scala)
    at org.apache.streampark.console.core.service.impl.ApplicationServiceImpl.lambda$start$10(ApplicationServiceImpl.java:1544)
    at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1604)
    ... 3 more
Caused by: java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.ObjectMapper.readerFor(Ljava/lang/Class;)Lcom/fasterxml/jackson/databind/ObjectReader;
    at org.json4s.jackson.JsonMethods.parse(JsonMethods.scala:26)
    at org.json4s.jackson.JsonMethods.parse$(JsonMethods.scala:21)
    at org.json4s.jackson.JsonMethods$.parse(JsonMethods.scala:83)
    at org.apache.streampark.flink.client.tool.FlinkSessionSubmitHelper$.$anonfun$submitViaRestApi$1(FlinkSessionClientHelper.scala:77)
    at scala.util.Try$.apply(Try.scala:209)
    at org.apache.streampark.flink.client.tool.FlinkSessionSubmitHelper$.submitViaRestApi(FlinkSessionClientHelper.scala:77)
    at org.apache.streampark.flink.client.impl.RemoteClient$.$anonfun$restApiSubmit$1(RemoteClient.scala:122)
    at scala.util.Try$.apply(Try.scala:209)
    at org.apache.streampark.flink.client.impl.RemoteClient$.restApiSubmit(RemoteClient.scala:115)
    at org.apache.streampark.flink.client.impl.RemoteClient$.$anonfun$doSubmit$1(RemoteClient.scala:48)
    at org.apache.streampark.flink.client.trait.FlinkClientTrait.$anonfun$trySubmit$1(FlinkClientTrait.scala:209)
    at scala.util.Try$.apply(Try.scala:209)
    at org.apache.streampark.flink.client.trait.FlinkClientTrait.trySubmit(FlinkClientTrait.scala:207)
    at org.apache.streampark.flink.client.trait.FlinkClientTrait.trySubmit$(FlinkClientTrait.scala:203)
    at org.apache.streampark.flink.client.impl.RemoteClient$.doSubmit(RemoteClient.scala:49)
    at org.apache.streampark.flink.client.trait.FlinkClientTrait.submit(FlinkClientTrait.scala:125)
    at org.apache.streampark.flink.client.trait.FlinkClientTrait.submit$(FlinkClientTrait.scala:62)
    at org.apache.streampark.flink.client.impl.RemoteClient$.submit(RemoteClient.scala:36)
    at org.apache.streampark.flink.client.FlinkClientHandler$.submit(FlinkClientHandler.scala:40)
    at org.apache.streampark.flink.client.FlinkClientHandler.submit(FlinkClientHandler.scala)
    ... 16 more

Screenshots

No response

Are you willing to submit PR?

Code of Conduct

adu-shzz commented 1 year ago

发现是 【系统设置 => Flink 版本 => Flink Home】 下边的 lib/ 目录,复制进来了一些会有冲突的 jar ,该目录应该只有 Flink 安装包默认的 jar,不应该放入作业依赖 jar。