Ritesh Sinha
Ritesh Sinha

Reputation: 840

Error while submiting topology to storm clustre

I am running a storm topology .This is the basic wordcount topology.I am using text file as the source and storm for processing the data.While submitting the i am facing these issues.I am very new to storm.Please suggest me the changes i need to do in the following code.Thanks in Advance !!

My topology

public class TopologyMain {
public static void main(String[] args) throws InterruptedException, AlreadyAliveException, InvalidTopologyException {

    //Topology definition
    TopologyBuilder builder = new TopologyBuilder();
    builder.setSpout("word-reader",new WordReader());
    builder.setBolt("word-normalizer", new WordNormalizer())
        .shuffleGrouping("word-reader");
    builder.setBolt("word-counter", new WordCounter(),1)
        .fieldsGrouping("word-normalizer", new Fields("word"));

    //Configuration
    Config conf = new Config();
    conf.put("wordsFile", args[0]);
    conf.setDebug(false);
    //Topology run
    conf.put(Config.TOPOLOGY_MAX_SPOUT_PENDING, 1);
    conf.put(Config.NIMBUS_HOST, "192.168.1.229");
    //LocalCluster cluster = new LocalCluster();
    //cluster.submitTopology("Getting-Started-Toplogie", conf, builder.createTopology());
    //Thread.sleep(1000);
    System.setProperty("storm.jar", "/home/raremile/st/examples-ch02-getting_started/target/Getting-Started-0.0.1-SNAPSHOT.jar");
    StormSubmitter.submitTopology("Count-Word-Topology-With-Refresh-Cache", conf,
    builder.createTopology());
    //cluster.shutdown();
  }
}

ERROR

Exception in thread "main" java.lang.NoSuchMethodError: backtype.storm.topology.TopologyBuilder.setBolt(Ljava/lang/String;Lbacktype/storm/topology/IBasicBolt;Ljava/lang/Integer;)Lbacktype/storm/topology/BoltDeclarer; at TopologyMain.main(TopologyMain.java:21)

I am able to run this code in local mode without any error.

Upvotes: 1

Views: 249

Answers (1)

Ritesh Sinha
Ritesh Sinha

Reputation: 840

changed the version to the 0.9.0.1 and i am able to run it

<dependency>
<groupId>storm</groupId>
<artifactId>storm</artifactId>
<version>0.9.0.1</version>
</dependency>

Upvotes: 1

Related Questions