|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
how can i debug java node |
« View previous topic :: View next topic » |
Author |
Message
|
reachguna |
Posted: Fri Oct 11, 2002 7:55 am Post subject: how can i debug java node |
|
|
Newbie
Joined: 10 Oct 2002 Posts: 5
|
Hi ,
How can i debug the java node deployed into the broker?
Anybody has thoughts how to do?
Thanks,
Chandra |
|
Back to top |
|
 |
marko |
Posted: Fri Oct 11, 2002 8:43 am Post subject: |
|
|
Apprentice
Joined: 28 Feb 2002 Posts: 27
|
Tracing to a log file has worked well for me. |
|
Back to top |
|
 |
reachguna |
Posted: Fri Oct 11, 2002 9:13 am Post subject: |
|
|
Newbie
Joined: 10 Oct 2002 Posts: 5
|
Hi,
Thanks for your reply. Can you explain with more details.
Regds,
Chandra. |
|
Back to top |
|
 |
marko |
Posted: Fri Oct 11, 2002 11:25 am Post subject: |
|
|
Apprentice
Joined: 28 Feb 2002 Posts: 27
|
Basically append to a file on your local filesystem, then print trace statements to the file. You can then examine the file to see what happened in your plugin.
I have not tried it, but it may also be possible to configure WMQI so that you can attach a remote debugger to your code. But personally I prefer tracing, especially as a post-mortum mechanism to analyse a failure in a running system (like your production system).
Here is some code that may help.
Code: |
if ( msg == null )
{
throw new NullPointerException( "Trace message is null.'" );
}
if ( traceFile == null )
{
traceFile = new FileOutputStream( "trace.log", true );
}
// reset the traceByteBuffer.
traceByteBuffer.reset();
// maximize buffering.
final boolean autoFlush = false;
PrintWriter msgWriter = new PrintWriter( traceByteBuffer, autoFlush );
msgWriter.println( "some header text..." );
msgWriter.println( msg );
msgWriter.println( "some footer text..." );
msgWriter.flush();
msgWriter.close();
//
// if tracing is performed in parallel to the same trace file,
// which can occur with multiple flow instances or exec groups,
// then we need to flush the trace entry atomically to avoid interleaving of
// seperate log entries.
traceByteBuffer.writeTo( traceFile );
traceFile.flush();
|
|
|
Back to top |
|
 |
mmarq |
Posted: Fri Oct 11, 2002 12:50 pm Post subject: how to debug a java node |
|
|
Acolyte
Joined: 19 Sep 2002 Posts: 74 Location: Newton, MA
|
Hi there,
In the new "Developing Solutions in Websphere MQ Integrator" redbook - it talks about the use of JDB which is a java debugger that comes w/Java.
You can reference the document for Java Debugging here:
www.ibm.com/developerWorks.
Chapt 7 - Section 7.5.2 of the redbook I mentioned above goes through an example of how to debug a node using jdb.
Good luck!
Melissa _________________ M Marquis |
|
Back to top |
|
 |
lillo |
Posted: Sat Oct 12, 2002 4:35 am Post subject: |
|
|
Master
Joined: 11 Sep 2001 Posts: 224
|
Also chapter 7 will show you how to debug java nodes using WebSphere Application Developer.
Cheers, _________________ Lillo
IBM Certified Specialist - WebSphere MQ |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|