我使用apache storm来使用kafka源处理数据,但在以集群模式运行Storm的地方,他为我返回了erreur:
我将此命令行风暴jar /我的jar文件args1的路径

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:106)
at backtype.storm.utils.Utils.readDefaultConfig(Utils.java:126)
at backtype.storm.utils.Utils.readStormConfig(Utils.java:146)
at backtype.storm.StormSubmitter.submitTopology(StormSubmitter.java:45)
at com.storm.Topologie.main(Topologie.java:48)


这是我在pom.xml中的文件依赖项:

<dependencies>
       <dependency>
        <groupId>org.apache.storm</groupId>
        <artifactId>storm-core</artifactId>
        <version>0.9.5</version>
        <!-- keep storm out of the jar-with-dependencies -->
        <scope>provide</scope>
    </dependency>
          <dependency>
      <groupId>org.apache.storm</groupId>
      <artifactId>storm-kafka</artifactId>
      <version>0.10.0</version>
      <type>jar</type>
  </dependency>
  <dependency>
      <groupId>org.apache.kafka</groupId>
      <artifactId>kafka_2.9.2</artifactId>
      <version>0.8.1.1</version>
      <exclusions>
          <exclusion>
              <groupId>org.apache.zookeeper</groupId>
              <artifactId>zookeeper</artifactId>
          </exclusion>
          <exclusion>
              <groupId>log4j</groupId>
              <artifactId>log4j</artifactId>
          </exclusion>
      </exclusions>
  </dependency>




还有我pom.xml的最后一部分

<build>
 <plugins>
   <plugin>
     <artifactId>maven-assembly-plugin</artifactId>
     <configuration>
       <descriptorRefs>
        <descriptorRef>jar-with-dependencies</descriptorRef>
       </descriptorRefs>
      <archive>
        <manifest>
         <mainClass>com.storm.Topologie</mainClass>
        </manifest>
      </archive>

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

最佳答案

<scope>provide</scope>


该“范围”无效。名称为“提供”:

<scope>provided</scope>


您的Maven作业是否已使用该pom.xml成功运行?检查,您也很可能试图从先前成功的构建中发布工件(胖罐)。也尝试执行clean目标。

关于java - 集群模式下的Apache Storm,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/35935782/

10-16 15:59