Tuesday, 7 August 2012

Google App Engine Error: No matching index found.

Most gae developers are faced with this problem when running the project on your local host then deploying on GAE. I have suffered from this for quite a long time, and now I am sharing the solution I used.

com.google.appengine.api.datastore.DatastoreNeedIndexException: no matching index found. 

Indexes are built when the definition file is uploaded to a server. It is needed for querying your data. And if this is not found, you get this error.

There are two possible workaround for this.

1. If you are testing from your local machine and a query is running, it is possible that /WEB-INF/appengine-generated/datastore-indexes-auto.xml is already created. Thus, you can deploy your application to GAE.

2. If you directly deployed the project to GAE, without running the query from your local machine, you can see that the file datastore-indexes-auto.xml is not found on the /WEB-INF/appengine-generated/ folder. Now, this may take sometime to be generated.

So what I do is, I run all the query once on local host, check whether the indexes has been generated and then deploy to GAE.




0 comments:

Post a Comment