首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >backtype.storm.generated.AlreadyAliveException

backtype.storm.generated.AlreadyAliveException
EN

Stack Overflow用户
提问于 2014-08-19 15:12:11
回答 1查看 1.6K关注 0票数 0

我正在尝试向我的风暴集群提交一个拓扑,在运行mvn包时我得到了以下错误

代码语言:javascript
复制
    [INFO] Scanning for projects...
    [INFO]                                                                         
    [INFO] ------------------------------------------------------------------------
    [INFO] Building storm-starter 0.0.1-SNAPSHOT
    [INFO] ------------------------------------------------------------------------
    [INFO] 
    [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ storm-starter ---
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] Copying 4 resources
    [INFO] 
    [INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ storm-starter ---
    [INFO] Compiling 15 source files to /Users/sharath/workspace/storm/target/classes
    [INFO] -------------------------------------------------------------
    [ERROR] COMPILATION ERROR : 
    [INFO] -------------------------------------------------------------
    [ERROR] /Users/sharath/workspace/storm/src/jvm/storm/starter/CustomToplogy.java:[41,35] unreported exception backtype.storm.generated.AlreadyAliveException; must be caught or declared to be thrown
    [INFO] 1 error
    [INFO] -------------------------------------------------------------
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 2.396 s
    [INFO] Finished at: 2014-08-19T20:35:37+05:30
    [INFO] Final Memory: 17M/81M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project storm-starter: Compilation failure
    [ERROR] /Users/sharath/workspace/storm/src/jvm/storm/starter/CustomToplogy.java:[41,35] unreported exception backtype.storm.generated.AlreadyAliveException; must be caught or declared to be thrown
    [ERROR] -> [Help 1]
    [ERROR] 
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR] 
    [ERROR] For more information about the errors and possible solutions, please read the following articles:

[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

我做了一些研究,发现如果集群上已经存在同名的拓扑,就会发生错误。但我询问了风暴,发现没有这样的拓扑。

有人能帮我了解一下发生了什么吗?拓扑的代码如下..

代码语言:javascript
复制
package storm.starter;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import backtype.storm.Config;
import backtype.storm.LocalCluster;
import backtype.storm.topology.TopologyBuilder;
import backtype.storm.utils.Utils;
import storm.starter.spout.Spout;

import storm.starter.bolt.RedisBolt;
import java.util.*;

import backtype.storm.StormSubmitter;

public class CustomTopology {

  public static void main(String[] args)  {
    TopologyBuilder builder = new TopologyBuilder();
    //List<String> hosts = new ArrayList<String>();
    //String host = args[0];
    String broker = "tcp://192.168.5.102:1443";
    String client = "test_client";
    String topic = "#";
    String redis_host = "192.168.5.102:6379";
    //hosts.add(host);

    builder.setSpout(...); //Omitted for security
    builder.setBolt(...); //Omitted for security
    Config conf = new Config();
    conf.setDebug(true);
    if (args != null && args.length > 0) {
      conf.setNumWorkers(3);

      StormSubmitter.submitTopology(args[0], conf, builder.createTopology());
    }
    else {

      LocalCluster cluster = new LocalCluster();
      cluster.submitTopology("CustomT1", conf, builder.createTopology());
      Utils.sleep(10000);
      cluster.killTopology("CustomT1");
      cluster.shutdown();
    }
  }
}

我使用https://github.com/miguno/wirbelsturm设置了暴风基础设施

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-08-19 21:22:31

您的拓扑没有活动,maven会在编译期间抛出该错误。

未报告的异常backtype.storm.generated.AlreadyAliveException;必须被捕获或声明为引发

这意味着你must catch or specify an exception is thrown

更改这一行:

代码语言:javascript
复制
public static void main(String[] args)  {

对此:

代码语言:javascript
复制
public static void main(String[] args) throws Exception {
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25387005

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档