I got the same error.  My problem was that the index that was auto
generated for my query was still being built.  Check the Datastore
Indexes page in your Dashboard.


On May 5, 12:25 am, JY <jy2...@gmail.com> wrote:
> I have a very simple java web app, tested on local 127.0.0.1, without
> any problem, but got error on Google.
>
> The model is plain pojo, and the function is straight forward
> List<MyModel> results = new ArrayList();
>                 PersistenceManager pm = PersistenceManagerSingeton.instance
> ().getPersistenceManager();
>                 int startId = pageNumber*pageSize;
>                 int endId = startId+pageSize+1;
>                 Query query = pm.newQuery(MyModel.class);
>             query.setOrdering("id desc");
>             query.setRange(startId, endId);
>             try {
>                 results = (List< MyModel >) query.execute();
>
>             } finally {
>                 query.closeAll();
>                 pm.close();
>             }
> The "id" is the PK
>         @PrimaryKey
>     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>         private Long id;
>
> This works fine on my local testing (Eclipse+App-Engine-Plug-in)
>
> Today, I got account approval email from Google, and uploaded this app
> to app-engine. However when I was testing it, always got below error:
>
> com.google.appengine.api.datastore.DatastoreNeedIndexException: no
> matching index found.
>         at
> com.google.appengine.api.datastore.DatastoreApiHelper.translateError
> (DatastoreApiHelper.java:34)
>         at com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall
> (DatastoreApiHelper.java:55)
>         at com.google.appengine.api.datastore.DatastoreServiceImpl
> $PreparedQueryImpl.runQuery(DatastoreServiceImpl.java:310)
>         at com.google.appengine.api.datastore.DatastoreServiceImpl
> $PreparedQueryImpl.access$100(DatastoreServiceImpl.java:240)
>         at com.google.appengine.api.datastore.DatastoreServiceImpl
> $PreparedQueryImpl$1.iterator(DatastoreServiceImpl.java:269)
>         at
> org.datanucleus.store.appengine.query.RuntimeExceptionWrappingIterable.iter­ator
> (RuntimeExceptionWrappingIterable.java:42)
>         at org.datanucleus.store.appengine.query.StreamingQueryResult.<init>
> (StreamingQueryResult.java:72)
>         at
> org.datanucleus.store.appengine.query.DatastoreQuery.fulfillEntityQuery
> (DatastoreQuery.java:253)
>         at org.datanucleus.store.appengine.query.DatastoreQuery.performExecute
> (DatastoreQuery.java:220)
>         at org.datanucleus.store.appengine.query.JDOQLQuery.performExecute
> (JDOQLQuery.java:85)
>         at org.datanucleus.store.appengine.query.JDOQLQuery.performExecute
> (JDOQLQuery.java:31)
>         at org.datanucleus.store.query.Query.executeQuery(Query.java:1466)
>         at org.datanucleus.store.query.Query.executeWithArray(Query.java:
> 1340)
>         at org.datanucleus.store.query.Query.execute(Query.java:1313)
>         at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:218)
>
> My understanding is that query as simple as above, should not need
> manual index.
> I noticed there was nothing the generated datastore-indexes-auto.xml,
> just <datastore-indexes/>. It makes sense since all my operations are
> save, delete and select-all-type of query
>
> I even tried creating manually the datastore-index.xml with below:
> <?xml version="1.0" encoding="utf-8"?>
> <datastore-indexes
>   xmlns="http://appengine.google.com/ns/datastore-indexes/1.0";
>   autoGenerate="true">
>     <datastore-index kind="WordeePuzzle" ancestor="false">
>         <property name="id" direction="desc" />
>     </datastore-index>
>
> </datastore-indexes>
>
> Tested on Google, and got same error.
>
> Please help
>
> Thanks.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to