MangoCool

java.lang.RuntimeException: Found multiple defaults.yaml resources. You're probably bundling the Storm jars with your topology jar.

2017-03-23 20:44:20   作者:MangoCool   来源:MangoCool

在storm项目中,打好jar包,到集群环境下运行:

bin/storm jar kafkaStorm-1.0-SNAPSHOT.jar com.storm.Topology
出现报错:
Caused by: java.lang.RuntimeException: Found multiple defaults.yaml resources. You're probably bundling the Storm jars with your topology jar. [jar:file:/opt/beh/core/storm/kafkaStorm-1.0-SNAPSHOT.jar!/defaults.yaml, jar:file:/opt/beh/core/storm/lib/storm-core-0.9.6.jar!/defaults.yaml]
        at backtype.storm.utils.Utils.findAndReadConfigFile(Utils.java:133)
        at backtype.storm.utils.Utils.readDefaultConfig(Utils.java:160)
        at backtype.storm.utils.Utils.readStormConfig(Utils.java:184)
        at backtype.storm.utils.Utils.<clinit>(Utils.java:71)

原因:

在storm-core包中有defaults.yaml这个文件,因为默认maven打包的scope是compile,所以maven打包后,本地的storm-core包也被打入的jar,由于集群环境中,也存在storm-core包,所以会出现文件defaults.yaml重复的错误。

解决办法:

1、可以在打包后删除该文件;

2、也可以设置storm-core包的scope,如下:

<dependency>
	<groupId>org.apache.storm</groupId>
	<artifactId>storm-core</artifactId>
	<version>${storm.version}</version>
	<scope>provided</scope>
</dependency>

标签: storm error

分享:

上一篇java.lang.IllegalArgumentException: message does not exist

下一篇IDEA配置maven(配置阿里云中央仓库)

关于我

崇尚极简,热爱技术,喜欢唱歌,热衷旅行,爱好电子产品的一介码农。

座右铭

当你的才华还撑不起你的野心的时候,你就应该静下心来学习,永不止步!

人生之旅历途甚长,所争决不在一年半月,万不可因此着急失望,招精神之萎葸。

Copyright 2015- 芒果酷(mangocool.com) All rights reserved. 湘ICP备14019394号

免责声明:本网站部分文章转载其他媒体,意在为公众提供免费服务。如有信息侵犯了您的权益,可与本网站联系,本网站将尽快予以撤除。