2

取得エラー:

java.lang.IllegalArgumentException: Can not deserialize instance of java.lang.String out of START_OBJECT token
 at [Source: N/A; line: -1, column: -1]

Caused by: com.google.appengine.repackaged.org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of java.lang.String out of START_OBJECT token
 at [Source: N/A; line: -1, column: -1]

私のエンティティのサンプル:

@PersistenceCapable
public class User {
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;
    public Key getKey() {return this.key;   }
    public User()   {}
    public Address getAddress() {return address;}
    public void setAddress(Address address) {this.address = address;}
    @Persistent
    private Address address;
}

@PersistenceCapable
public class Address {
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;
@Persistent
private String otherProperty;
//Also have the set and get
}

Google JavaScript API クライアント ツール ( https://code.google.com/p/google-api-javascript-client/ )を使用する

Eclipse で生成された Google クラウド エンドポイントに接続しています。- api Explorer を使用している間、問題なくアドレス (localhost:8888/_ah/api/explorer) を持つユーザーを追加できます。

アドレスを使用しない場合、呼び出しは期待どおりに機能します。

var request = gapi.client.userendpoint.user.insert({
firstName : "test",
lastName : "test",
emailAddress : "test",
phoneNumber : "test"
});
console.log(request);
request.execute(function(resp){console.log(resp);})

ただし、アドレスで呼び出すと失敗します。

var request2 = gapi.client.userendpoint.user.insert({
firstName : "test",
lastName : "test",
emailAddress : "test",
clubName : "test",
ahaNumber : "test",
phoneNumber : "test",
address: {
attention : "test",
line1 : "test",
line2 : "test",
line3 : "test",
state : "test",
postalCode : "test",
country : "test"
}
});
console.log(request2);
request2.execute(function(resp){console.log(resp);})

エラーあり:

POST http://localhost:8888/_ah/api/rpc 500 (Can not deserialize instance of java.lang.String out of START_OBJECT token  at [Source: N/A; line: -1, column: -1])

どんなフィードバックでも大歓迎です!

明らかな何かが欠けているように感じます...

4

0 に答える 0