当我打包flink程序时,我用命令运行jar scala -classpath my-flink-2-11-1.0-SNAPSHOT-jar-with-dependencies.jar com.littlely.batch.SimpleWordCount
,但出现了一些错误:
java.lang.NoSuchMethodError: akka.actor.ActorSystemImpl.<init>(Ljava/lang/String;Lcom/typesafe/config/Config;Ljava/lang/ClassLoader;Lscala/Option;Lscala/Option;Lakka/actor/setup/ActorSystemSetup;)V
at akka.actor.RobustActorSystem.<init>(RobustActorSystem.scala:41)
at akka.actor.RobustActorSystem$.internalApply(RobustActorSystem.scala:89)
at akka.actor.RobustActorSystem$.apply(RobustActorSystem.scala:70)
at akka.actor.RobustActorSystem$.create(RobustActorSystem.scala:55)
at org.apache.flink.runtime.akka.AkkaUtils$.createActorSystem(AkkaUtils.scala:125)
at org.apache.flink.runtime.akka.AkkaUtils$.createActorSystem(AkkaUtils.scala:113)
at org.apache.flink.runtime.akka.AkkaUtils.createActorSystem(AkkaUtils.scala)
at org.apache.flink.runtime.minicluster.MiniCluster.createRpcService(MiniCluster.java:743)
at org.apache.flink.runtime.minicluster.MiniCluster.start(MiniCluster.java:270)
at org.apache.flink.client.deployment.executors.LocalExecutor.startMiniCluster(LocalExecutor.java:117)
at org.apache.flink.client.deployment.executors.LocalExecutor.execute(LocalExecutor.java:63)
at org.apache.flink.api.java.ExecutionEnvironment.executeAsync(ExecutionEnvironment.java:944)
at org.apache.flink.api.java.ExecutionEnvironment.execute(ExecutionEnvironment.java:860)
at org.apache.flink.api.java.ExecutionEnvironment.execute(ExecutionEnvironment.java:844)
at org.apache.flink.api.java.DataSet.collect(DataSet.java:413)
at org.apache.flink.api.java.DataSet.print(DataSet.java:1652)
at org.apache.flink.api.scala.DataSet.print(DataSet.scala:1864)
at com.littlely.batch.SimpleWordCount$.main(SimpleWordCount.scala:20)
at com.littlely.batch.SimpleWordCount.main(SimpleWordCount.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at scala.reflect.internal.util.ScalaClassLoader$$anonfun$run$1.apply(ScalaClassLoader.scala:70)
at scala.reflect.internal.util.ScalaClassLoader$class.asContext(ScalaClassLoader.scala:31)
at scala.reflect.internal.util.ScalaClassLoader$URLClassLoader.asContext(ScalaClassLoader.scala:101)
at scala.reflect.internal.util.ScalaClassLoader$class.run(ScalaClassLoader.scala:70)
at scala.reflect.internal.util.ScalaClassLoader$URLClassLoader.run(ScalaClassLoader.scala:101)
at scala.tools.nsc.CommonRunner$class.run(ObjectRunner.scala:22)
at scala.tools.nsc.ObjectRunner$.run(ObjectRunner.scala:39)
at scala.tools.nsc.CommonRunner$class.runAndCatch(ObjectRunner.scala:29)
at scala.tools.nsc.ObjectRunner$.runAndCatch(ObjectRunner.scala:39)
at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:65)
at scala.tools.nsc.MainGenericRunner.run$1(MainGenericRunner.scala:87)
at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:98)
at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:103)
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
它可以在想法中运行,但当我打包它时,它无法运行。pom.xml中是否缺少某些内容?scala版本是2.11.12
暂无答案!
目前还没有任何答案,快来回答吧!