运行flink streaming程序报错:
报错信息如下:
Error:(21, 18) not enough arguments for method addSource: (implicit evidence$9: org.apache.flink.api.common.typeinfo.TypeInformation[String])org.apache.flink.streaming.api.scala.DataStream[String].
Unspecified value parameter evidence$9.
env.addSource(source)
报错原因:
flink的StreamExecutionEnvironment依赖导包错误
正确的是:
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment
正确依赖是:
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-java_${scala.version}</artifactId>
<version>${flink.version}</version>
</dependency>