Trying to call putty from java inside of a java agent

I am trying to build a javaAgent that will run a command server side. I believe I have all the necessary privelages of both the file system and the executable that I am running. (putty) but I still receive an error message stating “AMgr: Agent (‘javaAgentName’ in ‘location\nameOfDatabase.nsf’) error message: Error cleaning up agent threads”

My code isn’t that complicated and doesn’t do anything extrodinary except that it calls java.lang.Runtime

Begining code snippet:

String cmd = “some command”;

Process p = Runtime.getRuntime().exec(cmd);

BufferedReader in = new BufferedReader(

new InputStreamReader(p.getInputStream()));

String line = null;

while ((line = in.readLine()) != null) { System.out.println(line); }

System.out.println(“finished the while loop”);

End of code snippet:

It is inside of the java agent, and I never get to the “finished the while loop” part. I did some debugging and it looks as if it stops before the while loop. Does the runtime environment actually create a thread and doesn’t finish when the while loop is reading?

Any help will be VERY appreciative.