我对此进行了大量研究,但一直无法找到解决方案。我创建了最简单的单元测试来获取单个实体,但仍然收到“无法找到转换器”异常。我在我的类路径中包含了 org.restlet.ext.servlet.jar、org.json.jar 和 org.restlet.ext.net.jar。我还能够看到返回的 json,并且能够使用 cr.get(MediaType.APPLICATION_JSON) 方法进行打印。
ClientResource cr = new ClientResource("http://localhost:8888/r/establishment/29");
Establishment est = cr.get(Establishment.class);
System.out.println("Establishment name is " + est.getName());
我在 GAE 和 1.7.1 上使用 restlet-gae-2.1rc6