0

我正在编写 android 应用程序 - 客户端和 java 服务器。我正在使用restlet库。当我在手机上运行应用程序时,logcat 中出现以下错误: 11-19 13:43:53.665: E/dalvikvm(10130): Could not find class 'java.beans.XMLDecoder', referenced from method org.restlet.representation.ObjectRepresentation.<init>

我想我必须更改对象序列化方法(我更喜欢使用 Java 原生序列化,因为它就像在服务器上一样)但我不知道该怎么做。

android应用程序中的代码:

ClientResource cr = new ClientResource(
    "http://192.168.1.102:8182/speedLimit"
);

resource = cr.wrap(SpeedLimitsResource.class);
coords.setLatitude(55);
coords.setLongtitude(16.5);
pack = resource.retrieve(coords);

pack 和 coords 是在客户端和服务器之间共享的传输类的实例。它们实现了 Serializable,它们在同一个包中。

我怎样才能让它工作?

4

1 回答 1

1

确保您使用 android 版本的 restlet:http ://www.restlet.org/downloads/stable

于 2012-11-19T13:48:33.907 回答