I am trying to execute xmlaccess.bat file of web sphere Portal server uisng java but not getting any issue as well as no output but when i execute this bat file through command prompt,its working Fine..why it is ? dont'Know..please Help me out...
MyAPP :
public class BatchAPP {
public static void main(String[] args) throws IOException, InterruptedException {
Process p = Runtime.getRuntime().exec("C:\\IBM\\WebSphere\\wp_profile\\PortalServer\\bin\\xmlaccess.bat -user admin -password admin -url http://localhost:10039/wps/config -in pageExport.xml -out result.xml");
BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line;
while ((line = input.readLine()) != null) {
System.out.println(line);
}
input.close();
int waitFor = p.waitFor();
System.out.println("****Process****" + waitFor);
}
}
Command Is : xmlaccess.bat -user -password -url -in -out
That Bat File Reside in wHome/Portalserver/bin ----> If i run that application getting :
Exception in thread "main" java.io.IOException: Cannot run program "C:\IBM\WebSphere\wp_profile\PortalServer\bin\xmlaccess.bat": CreateProcess error=193, %1 is not a valid Win32 application