Bishoy Makram Bishoy Makram - 5 months ago 68
Java Question

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

So i updated the question and the title now because now i know the problem.
This is the worker log, I know there are lots of questions like this one (here) but I can't get any of the solutions to work whatever I do.


Edit: It's the same problem as the mentioned in the link but with
different cause as mentioned in the answer below.


This is the worker log.

2016-06-23 00:10:56.115 STDERR [INFO] Exception in thread "main" java.lang.ExceptionInInitializerError
2016-06-23 00:10:56.122 STDERR [INFO] at org.apache.storm.config$read_storm_config.invoke(config.clj:78)
2016-06-23 00:10:56.124 STDERR [INFO] at org.apache.storm.daemon.worker$_main.invoke(worker.clj:768)
2016-06-23 00:10:56.124 STDERR [INFO] at clojure.lang.AFn.applyToHelper(AFn.java:165)
2016-06-23 00:10:56.124 STDERR [INFO] at clojure.lang.AFn.applyTo(AFn.java:144)
2016-06-23 00:10:56.125 STDERR [INFO] at org.apache.storm.daemon.worker.main(Unknown Source)
2016-06-23 00:10:56.125 STDERR [INFO] 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:/media/bishoymak/All/College/New%20GP/Second/Programs/storm/lib/storm-core-1.0.1.jar!/defaults.yaml, jar:file:/media/bishoymak/All/College/New%20GP/Second/Programs/storm/storm-local/supervisor/stormdist/LogAnalyserStorm-1-1466632686/stormjar.jar!/defaults.yaml]
2016-06-23 00:10:56.126 STDERR [INFO] at org.apache.storm.utils.Utils.findAndReadConfigFile(Utils.java:307)
2016-06-23 00:10:56.126 STDERR [INFO] at org.apache.storm.utils.Utils.readDefaultConfig(Utils.java:351)
2016-06-23 00:10:56.127 STDERR [INFO] at org.apache.storm.utils.Utils.readStormConfig(Utils.java:387)
2016-06-23 00:10:56.127 STDERR [INFO] at org.apache.storm.utils.Utils.<clinit>(Utils.java:119)
2016-06-23 00:10:56.127 STDERR [INFO] ... 5 more
2016-06-23 00:10:56.128 STDERR [INFO] Caused by: java.io.IOException: Found multiple defaults.yaml resources. You're probably bundling the Storm jars with your topology jar. [jar:file:/media/bishoymak/All/College/New%20GP/Second/Programs/storm/lib/storm-core-1.0.1.jar!/defaults.yaml, jar:file:/media/bishoymak/All/College/New%20GP/Second/Programs/storm/storm-local/supervisor/stormdist/LogAnalyserStorm-1-1466632686/stormjar.jar!/defaults.yaml]


and here is my pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>StormExample</groupId>
<artifactId>StormExample</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>

<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source/>
<target/>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>

<executions>
<execution>
<id>LogAnalyserStorm</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<includes>
<include>LogAnalyserStorm.class</include>
<include>FakeCallLogReaderSpout.class</include>
<include>CallLogCounterBolt.class</include>
<include>CallLogCreatorBolt.class</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>

</plugins>
</build>
<repositories>
<repository>
<id>clojars.org</id>
<url>http://clojars.org/repo</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.apache.storm</groupId>
<artifactId>storm-core</artifactId>
<version>1.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.1.Final</version>
<scope>provided</scope>
</dependency>
</dependencies>


I used mvn jar:jar and mvn package but it always includes the storm core although i am stating that it only includes the 4 classes to include, so please tell me what am I doing wrong.


and here is my topology code:

public static void main(String[] args) throws Exception{
//Create Config instance for cluster configuration
Config config = new Config();
config.setDebug(true);

TopologyBuilder builder = new TopologyBuilder();
builder.setSpout("call-log-reader-spout", new FakeCallLogReaderSpout());

builder.setBolt("call-log-creator-bolt", new CallLogCreatorBolt())
.shuffleGrouping("call-log-reader-spout");

builder.setBolt("call-log-counter-bolt", new CallLogCounterBolt())
.fieldsGrouping("call-log-creator-bolt", new Fields("call"));

System.setProperty("storm.jar", "/media/bishoymak/All/College/New GP/Second/Programs/storm/lib/storm-core-1.0.1.jar");
StormSubmitter.submitTopology("LogAnalyserStorm", config, builder.createTopology());

Answer

That problem had to do nothing about the pom.xml just remove this line

System.setProperty("storm.jar", "/media/bishoymak/All/College/New GP/Second/Programs/storm/lib/storm-core-1.0.1.jar");