Mistakes in learning Flink programming

error prompt: uncaught exception during scala.MatchError

scalac: Error: false (of class scala.reflect.internal.Trees$Literal)

solution: too many SDKS of Scala are installed, resulting in conflicts and unable to compile normally. Delete the redundant SDKS and keep the locally configured SDKS. File-> Project Structure-> Click the plus sign to add the locally configured SDK, delete other redundant SDKS, and click Apply to finally recompile it.

error: not enough arguments for method addSource: (implicit evidence $9: org.apache.flink.api.com mon. Typeinfo. TypeInformation [String]) org. Apache. Flink. Streaming. API. Scala. DataStream [String].

Unspecified value parameter evidence$9.val stream3 = env.addSource(new FlinkKafkaConsumer011[String](” sensor “, new SimpleStringSchema(), properties))

solution: the SDK was not configured well, so the corresponding jar package was not imported successfully. Just reset the SDK.

ERROR: ERROR ERROR when sending a message to the topic topic_lcc with key: null value: 28 bytes with the ERROR: (org. Apache. Kafka. Clients. Producer. The internals. ErrorLoggingCallback)

org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms.

solution: Kafka link timeout can be detected according to the error, because no zookeeper has been started, so start a zookeeper and it will run normally.

Read More: