Debug ProcessBuilder Process inside of Eclipse

Viewed 373

So first, let me explain what I want to achieve. I got web application(Let's call it MainApp) which is run by jBoss web container. And my MainApp is starting jar file as separate process via ProcessBuilder.

I read that I should use eclipse feature "Remote Java Application", but it seems that it is not working for me.

So let me tell you what steps I am following:

java -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 -jar secondApp.jar
  • in my ProcessBuilder, I am setting my command line to above instruction
  • in run->debug configuration I am setting new remote java application with host set to localhost and port set to 5005.
  • and than I am running MainApp in jBoss container from eclipse on port 8010.
  • and than I am not sure what should I do.

So let me add some notes to better understand my issue. Inside of my WebApplication i got class with code like this:

    String commandLine = "java -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 -jar secondApp.jar";

    ProcessBuilder pb = new ProcessBuilder(commandLine);
    pb.run();

And it is working more or less like this: Deploy MainApp in jBoss, and when some action occure start new Process which starts secondApp.jar on server machine.

0 Answers
Related