Output Redirection and JIT Debugging

Erez Hadad <[email protected]> Mon, 13 Sep 2004 16:39:41 +0300
Newsgroups gmane.comp.java.jswat.user
Organization Technion - CS
Message-ID <[email protected]>
Hello,

I'm trying to run JSwat in batch mode by running it in console, feeding it a predefined script and activating it on demand using JPDA's onthrow directive. 
Thus, I'm using the foolowing bash script called jswat_ftd:

java -cp $JSWAT_HOME/jswat.jar:$JSWAT_HOME/parser.jar:$JSWAT_HOME/jclasslib.jar:$JAVA_HOME/lib/tools.jar:$CLASSPATH com.bluemarsh.jswat.Main -console "sourcepath $SOURCEPATH; attach $2; read dinput"

dinput is my script. For now it contains only:
where all
exit

I'm running my app using:
java -cp classes -Xdebug -Xrunjdwp:transport=dt_socket,server=y,onthrow=FullThreadDump.InvokeDebugger,launch=/home/erez/FTS/FullThreadDump/jswat_ftd FullThreadDump.Test

All this works well. When the exception is thrown, JSwat is invoked, attaches to the Test app and executes the script. 
Now, I also need the output to be redirected to a designated file, e.g. myfile.
So, I added output redirection to the script jswat_ftd:
.... > myfile

However, whenever I try this, JSwat aborts with "Connection refused" exception.
I also tried other alternatives, such as the script command. Same effect.

Any idea why this happens?

Thanks,
Erez Hadad