Java – com.caucho.hessian.client.HessianRuntimeException : com. ‘<' is unknown code

com.caucho.hessian.client.HessianRuntimeException : com. ‘<' is unknown code... here is a solution to the problem.

com.caucho.hessian.client.HessianRuntimeException : com. ‘<' is unknown code

I’m trying to establish basic Hessian communication between two Android devices.

The client sends the message AsyncTask

public class AsyncHessian extends AsyncTask<String,String,String> {

protected String doInBackground(String... params) {

String url = "";
        HessianProxyFactory factory = new HessianProxyFactory();
        TService basic = (TService) factory.create(TService.class, url);
        Log.i("Hello", "Hessian!");
    catch(Exception e){e.printStackTrace(); }
    return "";

Implementation of the server-side interface

public class TServiceImpl extends HessianServlet implements TService{

public static void main(String[] args) throws Exception {
    Server server = new Server(8080);
    Context context = new Context(server, "/", Context.SESSIONS);
    context.addServlet(TServiceImpl.class, "/test");

public void hello() {
    System.out.println("Hello Hessian!");


public interface TService {
public void hello();

The server is running jetty on the Android device.
Messages are being sent from the application to the server.

I’m sure the message has reached its destination because I get an ECONNREFUSED error when jetty stops. Now, when it opens, I get its title.


Configure your servlets in your web.xml

        <param-value>TServiceImpl's full name</param-value>
        <param-value>TService's full name</param-value>

See also:

Related Problems and Solutions