【问题标题】:Apache Storm Skipping Second CommandLine argumentApache Storm 跳过第二个命令行参数
【发布时间】:2015-06-03 13:14:55
【问题描述】:

今天我在我的 Storm Topology Builder 中遇到了一个奇怪而烦人的错误。
问题是当我将我的 jar 文件提交到 Storm 集群时,它总是跳过传递给 main 方法的第二个参数。

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

                            for(int i=0;i<(args.length);i++)
                            {   System.out.println("I=" +i+ " value="+args[i]);
                            }

这就是我提交 jar 的方式

E:\target>storm jar StormZeroMQ.jar com.wipro.bdas.zeromq.ZMQTopology 值1 值2 值3 值4 值5

输出

I=0 值=值1

I=1 值=值3

I=2 值=值4

I=3 值=值5

我尝试了所有组合、参数数量、参数类型等,但它跳过了第二个参数。
我想知道我错过了什么..
请帮帮我!

【问题讨论】:

    标签: java command-line command-line-arguments apache-storm


    【解决方案1】:

    经过一些调试,我发现它只发生在 windows machine 上。我能够在 2 Windows 机器中重现该错误。使用 Storm 的 0.9.3 和 0.9.4 版本。在 Linux 机器上,我可以看到命令行参数完美运行。

    为[此错误提出的 Jira 票证。 https://issues.apache.org/jira/browse/STORM-745
    更新:为以后的 windows Storm.cmd 版本修复了错误。

    【讨论】:

      猜你喜欢
      • 2016-03-20
      • 1970-01-01
      • 2011-04-10
      • 1970-01-01
      • 2018-07-17
      • 1970-01-01
      • 1970-01-01
      • 2014-05-30
      • 2020-08-10
      相关资源
      最近更新 更多