Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 集群模式下的apachestorm_Java_Maven_Apache Kafka_Apache Storm - Fatal编程技术网

Java 集群模式下的apachestorm

Java 集群模式下的apachestorm,java,maven,apache-kafka,apache-storm,Java,Maven,Apache Kafka,Apache Storm,我使用ApacheStorm使用kafka源代码处理数据,但在集群模式下运行storm时,他为我返回以下错误: 我使用这个命令行storm jar/path访问我的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

我使用ApacheStorm使用kafka源代码处理数据,但在集群模式下运行storm时,他为我返回以下错误: 我使用这个命令行storm jar/path访问我的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>

org.apache.storm
风暴核心
0.9.5
提供
org.apache.storm
卡夫卡风暴
0.10.0
罐子
org.apache.kafka
卡夫卡2.9.2
0.8.1.1
org.apache.zookeeper
动物园管理员
log4j
log4j

还有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>

maven汇编插件
带有依赖项的jar
com.storm.Topologie
组装
包裹
单一的

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

<scope>provided</scope>
已提供
您的maven作业是否使用pom.xml成功运行?检查一下,您还可能试图发布来自先前成功构建的工件(fatjar)。尝试执行清理目标。

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

<scope>provided</scope>
已提供

您的maven作业是否使用pom.xml成功运行?检查一下,您还可能试图发布来自先前成功构建的工件(fatjar)。尝试执行
clean
目标。

非常感谢,它工作得很好,我还删除了jara文件中的defaults.yaml文件,它工作得很好。您可以使用下面的命令从jar zip-d storm-example.jar defaults.yamlhank中删除defaults.yaml,它工作得很好,此外,我还删除了jara文件中的defaults.yaml文件,它可以工作。您可以使用下面的命令从jar zip-dstorm-example.jar defaults.yaml中删除defaults.yaml