I am calling Java ProcessBuilder to create a process from an exe file. the processes are created but they can not work ( in this case the work is doing sftp ) and hang after transfering a small number of bytes. they start to work properly after I Kill the java from windows task manager. 1- why the processes with a parent are restricted and does anybody know what are these restrictions? 2- How can I detach these processes from the parent ( Java Virtual Machine) to make them independent from windows point of view?
This is the Java Code calling exe file:
public boolean RunFileClient(client_drive_info drive)
{
Process proc = null;
try {
System.out.println(currentDir+"\\FileClient.exe "+ drive.getIp()+ " "+drive.getPort()+" "+ clientinfo.getUser_id()+" "+ drive.getDrives_id()+" "+ drive.getDrive_letter()+":\\"+ " "+ this.clientrestartmsg.getFilename());
ProcessBuilder procb= new ProcessBuilder(currentDir+"\\FileClient.exe",drive.getIp(), ""+drive.getPort(),""+ clientinfo.getUser_id(),
""+ drive.getDrives_id(),drive.getDrive_letter()+":\\", clientrestartmsg.getFilename() );
proc=procb.start();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
drive.setFileClientProc(proc);
return true;
}
The FileClient.exe is a windows application which runs without any userinterface commmunication and uses libssh (ssh1) libraries to do SFTP. all the parameters are received correctly by exe program and it works fine when it is called during CreateProcess of Microsoft VC++. it also works fine when transferring small files. and also it works fine if you kill Java Virtual machine! Nothing is read from this program stdout. I could put all source codes but the site limits maximum length.