我写了一个Flink程序来解析流数据。我可以毫无问题地运行它。但是当我制作一个 jar 文件时,该 jar 文件不会运行。 为了制作 jar 文件,我遵循以下路径:
Flile ---> Project Structure ---> Artifacts ---> jar ---> From modules with dependencies
我将 META-INF 的目录更改为资源。之后我构建了工件。 jar 文件已构建;即使如此,我也无法运行它。当我想运行它时,我收到此错误:
Exception in thread "main" java.lang.Exception: Could not create actor system at org.apache.flink.runtime.clusterframework.BootstrapTools.startActorSystem(BootstrapTools.java:276) at org.apache.flink.runtime.clusterframework.BootstrapTools.startActorSystem(BootstrapTools.java:162) at org.apache.flink.runtime.metrics.util.MetricUtils.startMetricsActorSystem(MetricUtils.java:126) at org.apache.flink.runtime.minicluster.MiniCluster.start(MiniCluster.java:260) at org.apache.flink.streaming.api.environment.LocalStreamEnvironment.execute(LocalStreamEnvironment.java:120) at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.execute(StreamExecutionEnvironment.java:1510) at PooyaCo.App.main(App.java:38)
Caused by: com.typesafe.config.ConfigException$Missing: No configuration setting found for key 'akka.remote.artery'
奇怪的是,我按照上述步骤为 helloworld 程序制作 jar 文件,并且该 jar 文件运行时没有任何问题。我认为问题是因为 flink 依赖关系。
您能指导我解决这个问题吗?
任何帮助将不胜感激。
最佳答案
是的,正确进行此设置并非易事。最好的选择是遵循文档中的快速入门指南 - https://ci.apache.org/projects/flink/flink-docs-release-1.8/dev/projectsetup/java_api_quickstart.html -- 它展示了如何使用 Maven 和 gradle 来执行此操作。
关于java - 制作 jar 文件 : "No configuration setting found for key ' akka. remote.artery 时出错'",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56165175/