Multiple defaults.yaml resources found

when i tried to introduce the topology i found this

Exception in thread "main" java.lang.RuntimeException: Found multiple defaults.yaml resources. You're probably bundling the Storm jars with your topology jar.
at backtype.storm.utils.Utils.findAndReadConfigFile(Utils.java:115)
at backtype.storm.utils.Utils.readDefaultConfig(Utils.java:135)
at backtype.storm.utils.Utils.readStormConfig(Utils.java:155)
at backtype.storm.StormSubmitter.submitTopology(StormSubmitter.java:61)
at backtype.storm.StormSubmitter.submitTopology(StormSubmitter.java:40)
at trident.myproject.main(myproject.java:288)

But this error appeared after the update in pom.xml

<scope>compile</scope> instead of <scope>provided</scope>

because i was a mistake

An exception occured while executing the Java class. storm/trident/state/StateFactory

here is the pom file

<plugins>
    <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
            <descriptorRefs>
                <descriptorRef>jar-with-dependencies</descriptorRef>
            </descriptorRefs>
            <archive>
                <manifest>
                    <mainClass>trident.myproject</mainClass>
                    <!-- <mainClass>crawler.Crawler</mainClass> -->
                </manifest>
            </archive>
        </configuration>

part 2 of the pom file

<executions>
    <execution>
        <id>make-assembly</id>
        <phase>package</phase>
        <goals>
            <goal>single</goal>
        </goals>
    </execution>
</executions>

part 3 of the pom file

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
            <source>1.6</source>
            <target>1.6</target>
        </configuration>
    </plugin>
</plugins>
+7
source share
1 answer

There is a fundamental difference in starting the topology in LocalClusteror remotely via StormSubmitter(this is the default setting in the project).

storm-core <scope>provided</scope>, . provided maven, jar , JAR. , , - , default.yaml compile. storm-core jar . Storm defaults.yaml "" (.. ) jar . , Storm , , .

, provided , . , , CLASSPATH JVM. provided storm-core ClassNotFound.

, , compile Main/Bolt/Spout maven-jar-plugin. jar, storm-core.

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-jar-plugin</artifactId>
  <version>2.6</version>

  <executions>
    <execution>
      <id>MyTopology</id>
      <phase>package</phase>
      <goals>
        <goal>jar</goal>
      </goals>
      <configuration>
        <includes>
          <include>my/topology/package/**/*.class</include>
        </includes>
      </configuration>
    </execution>
  </executions>
</plugin>
+10

Source: https://habr.com/ru/post/1613261/


All Articles