2003-01-15 16:03:36 +01:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Smack: Debugging - Jive Software</title>
|
|
|
|
<link rel="stylesheet" type="text/css" href="style.css" />
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<div class="header">
|
|
|
|
Debugging with Smack
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="nav">
|
|
|
|
« <a href="index.html">Table of Contents</a>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
Smack includes a built-in debugging console that will let you track all XML traffic between
|
|
|
|
the client and server.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
When debugging mode is enabled, a debug window will appear when each new connection is created.
|
|
|
|
The window will contain the following information:
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<img src="images/debugwindow.gif" width="359" height="399" alt="" border="0" align="right">
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
<li>Client Traffic (red text) -- raw XML traffic generated by Smack and sent to the server.
|
|
|
|
<li>Server Traffic (blue text) -- raw XML traffic sent by the server to the client.
|
|
|
|
<li>Interpreted Packets (green text) -- shows XML packets from the server as parsed by Smack.
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
Debugging mode can be enabled in two different ways:
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<ol>
|
|
|
|
<li>Add the following line of code before creating new connections:<p>
|
2003-05-05 17:11:31 +02:00
|
|
|
<tt>XMPPConnection.DEBUG_ENABLED = true;</tt><p>
|
2003-01-15 16:03:36 +01:00
|
|
|
|
|
|
|
<li>Set the Java system property <tt>smack.debugEnabled</tt> to true. The
|
|
|
|
system property can be set on the command line such as:<p>
|
2003-05-05 07:02:01 +02:00
|
|
|
<tt>java -Dsmack.debugEnabled=true SomeApp </tt>
|
2003-01-15 16:03:36 +01:00
|
|
|
</ol>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
If you wish to explicity disable debug mode in your application, including using the command-line parameter,
|
|
|
|
add the following line to your application before opening new connections:
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
<tt>XMPPConnection.DEBUG_ENABLED = false;</tt>
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<br clear="all" /><br><br>
|
|
|
|
|
|
|
|
<div class="footer">
|
|
|
|
Copyright © Jive Software 2002-2003
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|