【问题标题】:Executing PMCMD command from JAVA Client从 JAVA 客户端执行 PMCMD 命令
【发布时间】:2015-06-24 11:38:03
【问题描述】:

我想从 JAVA 开始工作流程。我使用 SSH 连接到 informatica 服务器并执行命令 pmcmd 以启动工作流

JSch js = new JSch();
        Session s = js.getSession("username", "host", 22);
        s.setPassword("password");
        Properties config = new Properties();
        config.put("StrictHostKeyChecking", "no");
        s.setConfig(config);
        s.connect();

        Channel c = s.openChannel("exec");
        ChannelExec ce = (ChannelExec) c;

        ce.setCommand("pmcmd startworkflow -sv integrationservice -d Domain_dwhetl -u user -p pass-usd hq -f dvl wf_test");
        //ce.setCommand("find -name PMCMD");
        ce.setErrStream(System.err);

        ce.connect();

        BufferedReader reader = new BufferedReader(new InputStreamReader(ce.getInputStream()));
        String line;
        while ((line = reader.readLine()) != null) {
          System.out.println(line);
        }

        ce.disconnect();
        s.disconnect();

        System.out.println("Exit code: " + ce.getExitStatus());

当我运行它时,我收到错误:bash: pmcmd: command not found。 如果我添加 pmcmd.exe 的路径:

  ce.setCommand("/PMRootDir/pmcmd startworkflow -sv integrationservice -d Domain_dwhetl -u user -p pass-usd hq -f dvl wf_test");

我收到错误:/PMRootDir/pmcmd:加载共享库时出错:libpmasrt.so:无法打开共享对象文件:没有这样的文件或目录

但是当我直接在 informatica 服务器中运行这些命令时,工作流会成功启动。

谁能帮忙解决这个问题?

谢谢!

【问题讨论】:

    标签: java bash informatica informatica-powercenter


    【解决方案1】:

    您已将 PATH 设置为安装 Informatica 的位置,或者更具体地说是 pmcmd 可执行文件所在的目录。 在调用 pmcmd 之前添加导出命令。

    export PATH=<path Infa installation directory>:$PATH;
    

    【讨论】:

      【解决方案2】:

      @Samik,谢谢! 我已经添加了这个

      "export INFA_HOME=<path Infa installation directory>; " +
                          "export PM_HOME=<path Infa installation directory>; " +
                          "export PATH=$PATH:<path Infa installation directory>/server/bin; " +
                          "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<path Infa installation directory>/server/bin; "
      

      成功了

      【讨论】:

        【解决方案3】:

        您需要设置环境变量路径 示例

        导出 PATH=$PATH:/pwc/Informatica/10.2/server/bin 导出 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/pwc/Informatica/10.2/server/bi

        【讨论】:

          猜你喜欢
          • 2010-10-30
          • 1970-01-01
          • 2014-12-15
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2021-09-04
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多