我想从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服务器中运行这些命令时,工作流程就会成功启动。
任何人都可以帮忙解决这个问题吗?
谢谢!
答案 0 :(得分:1)
您已将PATH设置为安装Informatica的位置,或者更具体地说是pmcmd可执行文件所在的目录。 在调用pmcmd之前添加导出命令。
export PATH=<path Infa installation directory>:$PATH;
答案 1 :(得分:0)
"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; "
并且有效
答案 2 :(得分:0)
您需要设置环境变量路径 示例
export PATH = $ PATH:/pwc/Informatica/10.2/server/bin 导出LD_LIBRARY_PATH = $ LD_LIBRARY_PATH:/pwc/Informatica/10.2/server/bi