[jboss-user] [Beginners Corner] - Using ProcessBuilder to start a new process from a servlet

tina99 do-not-reply at jboss.com
Mon Feb 11 12:36:53 EST 2008


Hi,

we are using a webapp inside JBoss 4.2.2.GA. Sometimes we experienced a problem and the JBoss hanges up. So now we would like to start an external jar file for the specific problem, so if this process fails, JBoss remains intact. Inside a servlet we tried something like this:


  | String[] args = new String[]{
  |             "java",
  |             "-jar", 
  |             "ownext.jar"      
  |         };
  | 
  |         ProcessBuilder processBuilder = new ProcessBuilder(args);
  |         Process proc = processBuilder.start();
  | 
  |         InputStream is = proc.getInputStream();
  |         logProcessorResult(proc.getErrorStream());
  | 
  |         int exitVal = proc.waitFor();
  |         ...
  | 

Unfortunately we are now running into a classpath problem with the message "unable to access ownext.jar". We put the ownext.jar in jboss_dir/server/default/lib. How can we resolve this?

Thx,

Tina.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4128444#4128444

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4128444



More information about the jboss-user mailing list