I want to start workflow from JAVA. I connect to informatica server using SSH and execute the command pmcmd to start workflow
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());
When I run this I'm getting the error : bash: pmcmd: command not found. If I add path to pmcmd.exe:
ce.setCommand("/PMRootDir/pmcmd startworkflow -sv integrationservice -d Domain_dwhetl -u user -p pass-usd hq -f dvl wf_test");
I get the error: /PMRootDir/pmcmd: error while loading shared libraries: libpmasrt.so: cannot open shared object file: No such file or directory
But when I run those commands in informatica server directly the workflow starts successfully.
Cand anyone help to solve this problem?
Thank you!
You have set the PATH to where Informatica is installed, or more specifically the directory the pmcmd executable is present. Add the export command before calling pmcmd.