当我尝试将 Hessian 集成到 Andorid 时,我收到以下错误消息:
错误:无法访问找不到 javax.naming.spi.ObjectFactory 的 ObjectFactory 类文件
这是代码:
...
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 文件:
dependencies {
...
implementation group: 'com.caucho', name: 'hessian', version: '4.0.62'
...
}
有没有人有办法解决吗?我犯错了吗?非常感谢。