Storm submit Topology error: Found multiple defaults.yaml resources.

Storm submit Topology operation is divided into two native and running cluster, where the cluster is running needs to be packaged and copy the jar package to the cluster, perform the following ways:

bin / Storm JAR / opt / RUN / Storm-demo- 1.0 -SNAPSHOT-dependencies.jar org.mort.storm.kafka.KafkaTopologyBasic JAR-with- 
bin / Storm JAR [JAR package path] [where the main class name]

But sometimes error prompt program runs as follows:

Caused by: java.lang.RuntimeException: java.io.IOException: Found multiple defaults.yaml resources. You're probably bundling the Storm jars with your topology jar. [jar:file:/opt/run/storm-demo-1.0-SNAPSHOT-jar-with-dependencies.jar!/defaults.yaml, jar:file:/opt/module/apache-storm-1.2.3/lib/storm-core-1.2.3.jar!/defaults.yaml]
        at org.apache.storm.utils.Utils.findAndReadConfigFile(Utils.java:385)
        at org.apache.storm.utils.Utils.readDefaultConfig(Utils.java:429)
        at org.apache.storm.utils.Utils.readStormConfig(Utils.java:465)
        at org.apache.storm.utils.Utils.<clinit>(Utils.java:179)
        ... 39 more
Caused by: java.io.IOException: Found multiple defaults.yaml resources. You're probably bundling the Storm jars with your topology jar. [jar:file:/opt/run/storm-demo-1.0-SNAPSHOT-jar-with-dependencies.jar!/defaults.yaml, jar:file:/opt/module/apache-storm-1.2.3/lib/storm-core-1.2.3.jar!/defaults.yaml]
        at org.apache.storm.utils.Utils.getConfigFileInputStream(Utils.java:411)
        at org.apache.storm.utils.Utils.findAndReadConfigFile(Utils.java:364)
        ... 42 more

Cause of the problem is there is a storm-core defaults.yaml file below, and therefore conflict storm run-time error, and therefore modify the Maven configuration file, and add the scope attribute set provided:

<dependency>
    <groupId>org.apache.storm</groupId>
    <artifactId>storm-core</artifactId>
    <version>1.2.3</version>
    <scope>provided</scope>
</dependency>

represents a container provided arranged scope or JDK ranges have been supplied, and indicates that the package has been dependent on the target provided by the JDK containers (such as Tomcat), and loaded using only the classpath compiled, it is not included in the package when the target package.

Run again successfully submitted.

Guess you like

Origin www.cnblogs.com/MWCloud/p/11579743.html