Javatpoint Logo
Javatpoint Logo

Spring Remoting by Hessian Example

By the help of HessianServiceExporter and HessianProxyFactoryBean classes, we can implement the remoting service provided by hessian.

Advantage of Hessian

Hessian works well across firewall. Hessian is portable to integrate with other languages such as PHP and .Net.

Example of Remoting by Hessian

You need to create following files for creating a simple hessian application:

  3. web.xml
  4. hessian-servlet.xml
  5. client-beans.xml

It is the simple interface containing one method cube.


This class provides the implementation of Calculation interface.

3) web.xml

In this xml file, we are defining DispatcherServlet as the front controller. If any request is followed by .http extension, it will be forwarded to DispatcherServlet.

4) hessian-servlet.xml

It must be created inside the WEB-INF folder. Its name must be servletname-servlet.xml. It defines bean for CalculationImpl and HessianServiceExporter.

5) client-beans.xml

In this xml file, we are defining bean for HessianProxyFactoryBean. You need to define two properties of this class.

  1. serviceUrl
  2. serviceInterface

In this example, our project name is hessian, i.e. used as the context root in the serviceURL.


This class gets the instance of Calculation and calls the cube method.

How to run this example

Start and deploy the project, here we are assuming that server is running on 8888 port number. If the port number is different, change the serviceURL in client-beans.xml.

Then, Compile and Run the file.

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA