Caucho maker of Resin Server | Application Server (Java EE Certified) and Web Server


 

Resin Documentation

home company blog wiki docs 
app server 
 Resin Server | Application Server (Java EE Certified) and Web Server
 

hessian


Hessian provides debugging tools to view the wire protocol or serialized Hessian data.

Debugging requires Hessian 3.1.3 or later.

Debugging HessianServlet

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"

Serialized Hessian

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) {
  }
}

Copyright © 1998-2012 Caucho Technology, Inc. All rights reserved. Resin ® is a registered trademark. Quercustm, and Hessiantm are trademarks of Caucho Technology.

Cloud-optimized Resin Server is a Java EE certified Java Application Server, and Web Server, and Distributed Cache Server (Memcached).
Leading companies worldwide with demand for reliability and high performance web applications including SalesForce.com, CNET, DZone and many more are powered by Resin.

home company blog wiki docs 
app server