3

I need to execute the following command from a web application deployed on cloudfoundry.

String javaHome = System.getenv("JAVA_HOME");
String javaLocation = javaHome+"/bin/java";

String command = javaLocation+" -Xms256m -Xmx512m -Dcom.sun.btrace.probeDescPath=. -Dcom.sun.btrace.dumpClasses=false -Dcom.sun.btrace.debug=false -Dcom.sun.btrace.unsafe=false -cp "+btraceLib+":"+toolsLib+ " com.sun.btrace.client.Main "+pid+" "+probeScript;

Process p = runTime.exec(command);

But I get the following error:

Unable to open socket file: target process not responding or HotSpot VM not loaded

I tried with different bounds on heap-size for jvm but get the same error.

How can I resolve the error?

radimpe
  • 3,197
  • 2
  • 27
  • 46
user821075
  • 61
  • 2
  • 5
  • I started with the Workers on Cloudfoundry Weblog, and the twitter2rabbit app. After building and running this app I proceeded to use and build (mvn clean install) just the twitter2rabbit portion. I've included the app portion of the example in the answer below. – eightyoctane Jul 07 '12 at 19:07
  • http://blog.cloudfoundry.com/2012/05/09/running-workers-on-cloud-foundry-with-spring/ – eightyoctane Jul 07 '12 at 21:38

2 Answers2

1

Change:

Process p = runTime.exec(command);

To:

Process p = Runtime.getRuntime().exec(command);
eightyoctane
  • 639
  • 3
  • 6
0

Don't know the 'real' solution, but I downgraded to java 1.6 from 1.7 (where I had the same issue) and I could profile the application without this error.

Mitch1077487
  • 799
  • 6
  • 8