我想從JAVA啓動工作流程。我連接到服務器的Informatica使用SSH和執行命令PMCMD啓動工作從JAVA客戶端執行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:命令未找到。 如果我添加路徑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服務器上運行這些命令時,工作流成功啓動。
任何人都可以幫助解決這個問題嗎?
謝謝!