Re: Output Redirection and JIT Debugging

Nathan Fiedler <[email protected]> Mon, 13 Sep 2004 08:50:11 -0700
Newsgroups gmane.comp.java.jswat.user
Organization Blue Marsh Softworks
Message-ID <1095090610.2527.7.camel@nuts>
I'm not sure about the connection refused error, though chances are the
JVM was confused by the redirection.

Anyway, to get the output of JSwat to a file, just use the 'capture'
command to redirect the messages to a file. For instance,

  capture +file jswat.out

should redirect the thread dump to the file named jswat.out (in the
current working directory).

n


On Mon, 2004-09-13 at 06:39, Erez Hadad wrote:
> 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