执行调用时出现服务器异常:
var x = '{"name": "Test","address": { "street": "White House"}}';
gapi.client.realestate.create(x).execute(function(resp) {
console.log(resp);
});
java.lang.ClassCastException: com.google.appengine.repackaged.org.codehaus.jackson.node.TextNode cannot be cast to com.google.appengine.repackaged.org.codehaus.jackson.node.ObjectNode
at com.google.api.server.spi.tools.devserver.RpcApiServlet.doSingleBackendCall(RpcApiServlet.java:131)
at com.google.api.server.spi.tools.devserver.RpcApiServlet.service(RpcApiServlet.java:112)
如果我在 中使用相同的 JSON 表达式API Explorer
,它就可以工作。@ApiMethod
定义为:
@ApiMethod(name = "create", path = "properties", httpMethod = HttpMethod.POST)
public void create(RealEstateProperty property, User user) throws Exception {