mvn compile exec:java -Dstorm.topology=storm.starter.WordCountTopology
编译storm-starter时可能报错 !!!
遇见的错误:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoSuchMethodError: org.yaml.snakeyaml.Yaml.<init>(Lorg/yaml/snakeyaml/constructor/BaseConst
at backtype.storm.utils.Utils.findAndReadConfigFile(Utils.java:144)
at backtype.storm.utils.Utils.readDefaultConfig(Utils.java:167)
at backtype.storm.utils.Utils.readStormConfig(Utils.java:191)
at backtype.storm.config$read_storm_config.invoke(config.clj:121)
at backtype.storm.testing$mk_local_storm_cluster.doInvoke(testing.clj:123)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at backtype.storm.LocalCluster$_init.invoke(LocalCluster.clj:28)
at backtype.storm.LocalCluster.<init>(Unknown Source)
at storm.starter.WordCountTopology.main(WordCountTopology.java:82)
... 6 more
解决的办法:只需要修改pom.xml中的依赖
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8.5</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>snakeyaml</artifactId>
<groupId>org.yaml</groupId>
</exclusion>
</exclusions>
</dependency>
再次编译就ok了。
关于storm-starter编译异常解决!!!
最新推荐文章于 2022-02-26 15:53:49 发布