flink1.12.2之后的版本和scala的兼容性问题

发布于 2022-09-12 23:34:13 字数 2716 浏览 34 评论 0

刚开始学习flink,使用flink1.12.3,scala2.12写了一个本地程序后,运行的起来就会报错,下面图里这种:
image.png

网上到处都找不到相关的解答,但是经过试验,只要将flink版本降到1.12.1程序就正常了,这是为什么呢?
堆栈信息如下:
Exception in thread "main" java.lang.Exception: Could not create actor system

at org.apache.flink.runtime.clusterframework.BootstrapTools.startLocalActorSystem(BootstrapTools.java:281)
at org.apache.flink.runtime.rpc.akka.AkkaRpcServiceUtils$AkkaRpcServiceBuilder.createAndStart(AkkaRpcServiceUtils.java:361)
at org.apache.flink.runtime.rpc.akka.AkkaRpcServiceUtils$AkkaRpcServiceBuilder.createAndStart(AkkaRpcServiceUtils.java:344)
at org.apache.flink.runtime.minicluster.MiniCluster.createLocalRpcService(MiniCluster.java:952)
at org.apache.flink.runtime.minicluster.MiniCluster.start(MiniCluster.java:288)
at org.apache.flink.client.program.PerJobMiniClusterFactory.submitJob(PerJobMiniClusterFactory.java:75)
at org.apache.flink.client.deployment.executors.LocalExecutor.execute(LocalExecutor.java:85)
at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.executeAsync(StreamExecutionEnvironment.java:1905)
at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.execute(StreamExecutionEnvironment.java:1796)
at org.apache.flink.streaming.api.environment.LocalStreamEnvironment.execute(LocalStreamEnvironment.java:69)
at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.execute(StreamExecutionEnvironment.java:1782)
at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.execute(StreamExecutionEnvironment.java:1765)
at com.flnn.demo.WatermarkerDemo.main(WatermarkerDemo.java:51)

Caused by: java.lang.NoClassDefFoundError: akka/actor/ExtensionId$class

at org.apache.flink.runtime.akka.RemoteAddressExtension$.<init>(RemoteAddressExtension.scala:32)
at org.apache.flink.runtime.akka.RemoteAddressExtension$.<clinit>(RemoteAddressExtension.scala)
at org.apache.flink.runtime.akka.AkkaUtils$.getAddress(AkkaUtils.scala:804)
at org.apache.flink.runtime.akka.AkkaUtils.getAddress(AkkaUtils.scala)
at org.apache.flink.runtime.clusterframework.BootstrapTools.startActorSystem(BootstrapTools.java:298)
at org.apache.flink.runtime.clusterframework.BootstrapTools.startLocalActorSystem(BootstrapTools.java:279)
... 12 more

Caused by: java.lang.ClassNotFoundException: akka.actor.ExtensionId$class

at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 18 more

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文