【发布时间】: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