0
我有這樣的場景:空指針在GAE更新實體
- 安卓APP->通話endpoint-> getPerson(電子郵件)
- 端點返回我1個個人物P
- 我在Android上使用這個對象應用程序並更改一些值。
- 安卓APP->通話endpoint->的updatePerson(P)
我得到這個錯誤從服務器:
com.google.api.server.spi.SystemService invokeServiceMethod: null java.lang.NullPointerException at com.google.appengine.api.datastore.Key.getAppId(Key.java:279) at com.google.appengine.api.datastore.KeyTranslator.convertToPb(KeyTranslator.java:50) at com.google.appengine.api.datastore.EntityTranslator.convertToPb(EntityTranslator.java:48) at com.google.appengine.api.datastore.AsyncDatastoreServiceImpl$4.toPb(AsyncDatastoreServiceImpl.java:178) at com.google.appengine.api.datastore.AsyncDatastoreServiceImpl$4.toPb(AsyncDatastoreServiceImpl.java:155) at com.google.appengine.api.datastore.Batcher$BatchIterator.(Batcher.java:180) at com.google.appengine.api.datastore.Batcher$2.(Batcher.java:317) at com.google.appengine.api.datastore.Batcher.getBatches(Batcher.java:317) at com.google.appengine.api.datastore.AsyncDatastoreServiceImpl.doBatchPut(AsyncDatastoreServiceImpl.java:365) at com.google.appengine.api.datastore.BaseAsyncDatastoreServiceImpl.put(BaseAsyncDatastoreServiceImpl.java:293) at com.google.appengine.api.datastore.BaseAsyncDatastoreServiceImpl.put(BaseAsyncDatastoreServiceImpl.java:239) at com.google.appengine.api.datastore.DatastoreServiceImpl.put(DatastoreServiceImpl.java:61) at com.google.appengine.datanucleus.WrappedDatastoreService.put(WrappedDatastoreService.java:112) at com.google.appengine.datanucleus.EntityUtils.putEntitiesIntoDatastore(EntityUtils.java:766) at com.google.appengine.datanucleus.DatastorePersistenceHandler.insertObjectsInternal(DatastorePersistenceHandler.java:314) at com.google.appengine.datanucleus.DatastorePersistenceHandler.insertObject(DatastorePersistenceHandler.java:218) at org.datanucleus.state.JDOStateManager.internalMakePersistent(JDOStateManager.java:2381) at org.datanucleus.state.JDOStateManager.flush(JDOStateManager.java:3778) at org.datanucleus.ObjectManagerImpl.flushInternalWithOrdering(ObjectManagerImpl.java:3888) at org.datanucleus.ObjectManagerImpl.flushInternal(ObjectManagerImpl.java:3811) at org.datanucleus.ObjectManagerImpl.flush(ObjectManagerImpl.java:3751) at org.datanucleus.ObjectManagerImpl.preCommit(ObjectManagerImpl.java:4141) at org.datanucleus.ObjectManagerImpl.transactionPreCommit(ObjectManagerImpl.java:428) at org.datanucleus.TransactionImpl.internalPreCommit(TransactionImpl.java:398) at org.datanucleus.TransactionImpl.commit(TransactionImpl.java:287) at org.datanucleus.ObjectManagerImpl.close(ObjectManagerImpl.java:1090) at org.datanucleus.api.jpa.JPAEntityManager.close(JPAEntityManager.java:193)
是不是從數據存儲檢索相同的對象?
你可以發佈相關端點api類方法與註釋,以及調用這些函數的android代碼?在invokeservicemethod上獲得一個空指針異常看起來像你調用的API方法不存在,所以它可能被註釋/調用不正確。 – Nick 2014-12-18 22:43:30