我试图在我的Google数据存储区中插入数据,因此我通过google API资源管理器发送此请求:
POST https://local-sport-meeting-app.appspot.com/_ah/api/localSportMeetingApi/v1/rencontre
Content-Type: application/json
X-JavaScript-User-Agent: Google APIs Explorer
{
"date": {
"day": 30,
"hour": 20,
"minute": 15,
"month": 11,
"year": 2014
},
"idComp": "5153049148391424",
"idParticipant2": "5664902681198592",
"idPartiticpant1": "5734055144325120",
"latitude": 3.105024,
"lieu": "STADE MARCEL MICHELIN\"",
"longitude": 45.789907
}
但这会返回此错误:
400 Bad Request
- Show headers -
{
"error": {
"errors": [
{
"domain": "global",
"reason": "badRequest",
"message": "com.google.appengine.repackaged.org.codehaus.jackson.map.JsonMappingException: No suitable constructor found for type [simple type, class com.iutclermont.lpmobile.localsportmeeting.backend.DatePerso]: can not instantiate from JSON object (need to add/enable type information?)\n at [Source: N/A; line: -1, column: -1] (through reference chain: com.iutclermont.lpmobile.localsportmeeting.backend.Rencontre[\"date\"])"
}
],
"code": 400,
"message": "com.google.appengine.repackaged.org.codehaus.jackson.map.JsonMappingException: No suitable constructor found for type [simple type, class com.iutclermont.lpmobile.localsportmeeting.backend.DatePerso]: can not instantiate from JSON object (need to add/enable type information?)\n at [Source: N/A; line: -1, column: -1] (through reference chain: com.iutclermont.lpmobile.localsportmeeting.backend.Rencontre[\"date\"])"
}
}
我使用Objectify和Android工作室中的app引擎模块生成我的实体,并且我有一个空构造函数,如Objectify所要求的那样
是否有人已经遇到此问题或知道如何解决此问题。 感谢。