背景
flink1.12版本,需要添加hadoop依赖,依照之前打包方式
添加了flink-shaded-hadoop-3-uber-3.1.1.7.2.1.0-327-9.0.jar
地址:https://mvnrepository.com/artifact/org.apache.flink/flink-shaded-hadoop-3-uber/3.1.1.7.2.1.0-327-9.0
执行报错:
2021-04-06 16:20:11,778 ERROR org.apache.flink.runtime.taskexecutor.TaskManagerRunner [] - TaskManager initialization failed.
java.lang.NoSuchMethodError: org.apache.commons.cli.Option.builder(Ljava/lang/String;)Lorg/apache/commons/cli/Option$Builder;
at org.apache.flink.runtime.entrypoint.parser.CommandLineOptions.<clinit>(CommandLineOptions.java:28) ~[flink-dist_2.12-1.12.0.jar:1.12.0]
at org.apache.flink.runtime.entrypoint.ClusterConfigurationParserFactory.options(ClusterConfigurationParserFactory.java:41) ~[flink-dist_2.12-1.12.0.jar:1.12.0]
at org.apache.flink.runtime.entrypoint.ClusterConfigurationParserFactory.getOptions(ClusterConfigurationParserFactory.java:49) ~[flink-dist_2.12-1.12.0.jar:1.12.0]
at org.apache.flink.runtime.entrypoint.parser.CommandLineParser.parse(CommandLineParser.java:46) ~[flink-dist_2.12-1.12.0.jar:1.12.0]
at org.apache.flink.runtime.util.ConfigurationParserUtils.loadCommonConfiguration(ConfigurationParserUtils.java:123) ~[flink-dist_2.12-1.12.0.jar:1.12.0]
at org.apache.flink.runtime.taskexecutor.TaskManagerRunner.loadConfiguration(TaskManagerRunner.java:331) ~[flink-dist_2.12-1.12.0.jar:1.12.0]
at org.apache.flink.runtime.taskexecutor.TaskManagerRunner.runTaskManagerSecurely(TaskManagerRunner.java:342) [flink-dist_2.12-1.12.0.jar:1.12.0]
at org.apache.flink.runtime.taskexecutor.TaskManagerRunner.main(TaskManagerRunner.java:327) [flink-dist_2.12-1.12.0.jar:1.12.0]
解决办法
缺少commons-cli-1.2.jar
添加jar包到lib目录下,重新执行即可
网友评论