I get the following error message when I tried to integrate Hessian into Andorid:

error: cannot access ObjectFactory class file for javax.naming.spi.ObjectFactory not found

Here's the code:

...
import com.caucho.hessian.client.HessianProxyFactory;
import java.net.MalformedURLException;

public void hessianTest()  {

        String url = "http://hessian.caucho.com/test/test";
        HessianProxyFactory factory = new HessianProxyFactory();

        BasicAPI basic = null;
        try {
            basic = (BasicAPI) factory.create(BasicAPI.class, url);
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
        Log.i("hessianTest", "hello(): " + basic.hello());

    }
...

build.gradle File:

dependencies {
...
    implementation group: 'com.caucho', name: 'hessian', version: '4.0.62'
...
}

Does anyone have a solution? Have I made a mistake? Thank you very much.

0

There are 0 answers