Getting the Error - Failed to determine peer security context: Protocol not available
I have a service named 'dataService' when i am starting/stopping/restarting this service from the CLI it works absolutely fine but when i execute the service from my java code it gives the errorStream - "Failed to determine peer security context: Protocol not available".
Java Code :-
Process process = Runtime.getRuntime().exec(cmd.getCommandLine());
BufferedReader datainput = new BufferedReader(new InputStreamReader(process.getErrorStream()));
String inputLine;
StringBuffer buf = new StringBuffer();
while ((inputLine = datainput.readLine()) != null){
buf.append(inputLine).append("\n");
}
//Wait for Process to complete.
int returnCode = process.waitFor();
process.destroy();
This issue is only happening in RHEL7.X and CentOS 7.X or other 7.X architecture. Any help will be highly appreciated.
|