![]() | Resin Documentationapp server |
hessian
Hessian provides debugging tools to view the wire protocol or serialized Hessian data. Debugging requires Hessian 3.1.3 or later. Hessian servlet debugging is enabled in a two-step process. First, the "debug" init-param must be set in the web.xml. Second, the java.util.logging level for com.caucho.hessian.servlet must be set to "fine". The configuration in a Resin server might look like the following: resin-web.xml enabling debugging
<web-app xmlns="http://caucho.com/ns/resin">
<servlet-mapping url-pattern="/my-bean"
servlet-class="example.MyBean">
<init debug="true"/>
</servlet-mapping>
<log name="com.caucho.hessian.server" level="fine"
path="stdout:"/>
</web-app>
The output might look like the following: sample debugging output
public class MyBean extends HessianServlet {
public example.Combine combine(String a, String b)
}
[2007/05/08 02:51:31.000] call 2.0
[2007/05/08 02:51:31.000] method "combine"
[2007/05/08 02:51:31.000] "hello"
[2007/05/08 02:51:31.000] "world"
[2007/05/08 02:51:31.000] reply 2.0
[2007/05/08 02:51:31.000] /* defun example.Combine [a, b] */
[2007/05/08 02:51:31.000] object example.Combine (#1)
[2007/05/08 02:51:31.000] a: "hello"
[2007/05/08 02:51:31.000] b: "world"
Hessian provides two debugging streams to debug any input or output stream, HessianDebugInputStream and HessianDebugOutputStream. They can be used as follows: HessianDebugInputStream
import com.caucho.hessian.io.*;
...
void test(PrintWriter dbg, String filename)
throws IOException
{
FileInputStream is = new FileInputStream(filename);
HessianDebugInputStream in;
in = new HessianDebugInputStream(is, dbg);
int ch;
while ((ch = in.read()) >= 0) {
}
}
|