I'm trying to execute an external .exe that create a custom file an saves it on the server the i can
my code for ProcessBuilder
work fine on localhost but when i'm deploying it on my server, the document is not created andI have no error in my java web server
I tried to play with the environment variable of the ProcessBuilder
but no luck on that still not working
I'm out on ideas
Pleaze help me out Thats
Here is my code for processBuilder that works fine on localhost
try {
ProcessBuilder processBuilder = new ProcessBuilder("pathtoExe\\executable.exe");
processBuilder.redirectErrorStream(true);
processBuilder.redirectOutput();
processBuilder.redirectInput();
Process process = processBuilder.start();
InputStream is = process.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String line;
String s;
System.out.printf("Output of running is:");
while ((line = br.readLine()) != null) {
System.out.print("ligne out: ");
System.out.println(line);
}
BufferedReader stdError = new BufferedReader(
new InputStreamReader(process.getErrorStream()));
while ((s = stdError.readLine()) != null) {
System.out.println(s);
}
process.waitFor();
System.out.println(process.exitValue());
}
catch (IOException| InterruptedException e) {
e.printStackTrace();
}
If it might help someone, I found out that the user that start glassfish service did not had the rights to execute on network.
I put a user with the good rights and Voilà..
Thanks.