Exception in thread "main" java.lang.NoClassDefFoundError: scala/collection/immutable/StringOps ?? ?at org.apache.flink.runtime.akka.AkkaUtils$.testDispatcherConfig(AkkaUtils.scala:374) ?? ?at org.apache.flink.runtime.akka.AkkaUtils.testDispatcherConfig(AkkaUtils.scala) ?? ?at org.apache.flink.runtime.minicluster.MiniCluster.createLocalRpcService(MiniCluster.java:951) ?? ?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:1957) ?? ?at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.execute(StreamExecutionEnvironment.java:1848) ?? ?at org.apache.flink.streaming.api.environment.LocalStreamEnvironment.execute(LocalStreamEnvironment.java:69) ?? ?at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.execute(StreamExecutionEnvironment.java:1834) ?? ?at cn.flink.JavaDataStreamApp.main(JavaDataStreamApp.java:13) Caused by: java.lang.ClassNotFoundException: scala.collection.immutable.StringOps ?? ?at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ?? ?at java.lang.ClassLoader.loadClass(ClassLoader.java:418) ?? ?at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355) ?? ?at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ?? ?... 11 more
解决方法:
默认pom.xml中,scala版本为2.11
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-java_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-clients_${scala.binary.version}</artifactId>
<version>${flink.version}</version>
<scope>compile</scope>
</dependency>
查看当前工程中安装的scala版本,是否匹配。如果不存成,就安装匹配的scala 版本
?
?
|