我时不时地遇到这个错误。我通常最终会清理所有数据库。可能是什么原因?
这是在 Win XP SP3、GAE 1.6.5、Objectify 3.0、GWT 2.4 上。
QueryResultIterator<Key<x>> it = query.fetchKeys().iterator();
ArrayList<Key<x>> keys = new ArrayList<Key<x>> (num);
while (it != null && it.hasNext()) { <== error
keys.add(it.next());
}
这是错误 -
Caused by: java.lang.NullPointerException
at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:90)
at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:90)
at com.google.appengine.api.datastore.FutureHelper.getInternal(FutureHelper.java:72)
at com.google.appengine.api.datastore.FutureHelper.quietGet(FutureHelper.java:33)
at com.google.appengine.api.datastore.QueryResultsSourceImpl.peekQueryResultAndIfFirstRecordIndexList(QueryResultsSourceImpl.java:175)
at com.google.appengine.api.datastore.QueryResultsSourceImpl.loadMoreEntities(QueryResultsSourceImpl.java:111)
at com.google.appengine.api.datastore.QueryResultsSourceImpl.loadMoreEntities(QueryResultsSourceImpl.java:98)
at com.google.appengine.api.datastore.QueryResultIteratorImpl.ensureLoaded(QueryResultIteratorImpl.java:164)
at com.google.appengine.api.datastore.QueryResultIteratorImpl.hasNext(QueryResultIteratorImpl.java:66)
at com.googlecode.objectify.util.TranslatingIterator.hasNext(TranslatingIterator.java:29)