我正在苦於GAE留言板演示應用程序。我沒有做任何修改。我得到了它在本地運行,但是當我部署它,我得到以下錯誤:GAE數據存儲索引未創建
com.google.appengine.api.datastore.DatastoreNeedIndexException: no matching index found. recommended index is:
- kind: Greeting
ancestor: yes
properties:
- name: date
direction: desc
The suggested index for this query is:
<datastore-index kind="Greeting" ancestor="true" source="manual">
<property name="date" direction="desc"/>
</datastore-index>
在本地運行,目標/生成數據存儲的索引,auto.xml - 快照/ WEB-INF/appengine生成的目錄。此文件包含完全所需的索引說明:
<datastore-indexes>
<!-- Used 1 time in query history -->
<datastore-index kind="Greeting" ancestor="true">
<property name="date" direction="desc" />
</datastore-index>
</datastore-indexes>
但是,該應用程序拋出錯誤高於任何地方。
我也嘗試將它從自動生成的xml文件移動到手動xml(datastore-indexes.xml)文件。
當我通過mvn -e appengine:deploy
部署我沒有得到任何錯誤或警告:
...
[INFO] GCLOUD: Jan 02, 2017 8:01:14 PM com.google.apphosting.utils.config.IndexesXmlReader readConfigXml
[INFO] GCLOUD: INFO: Successfully processed /Users/stephanhofmann/Projects/mvntestapp/target/mvntestapp-1.0-SNAPSHOT/WEB-INF/datastore-indexes.xml
[INFO] GCLOUD: Jan 02, 2017 8:01:14 PM com.google.apphosting.utils.config.IndexesXmlReader readConfigXml
[INFO] GCLOUD: INFO: Successfully processed /Users/stephanhofmann/Projects/mvntestapp/target/mvntestapp-1.0-SNAPSHOT/WEB-INF/appengine-generated/datastore-indexes-auto.xml
...
不管怎麼說,谷歌的開發者控制檯不顯示任何「複合」索引時,我在數據存儲>指標檢查。我等了超過30分鐘(並且沒有數據,因此索引應該很快)。
不知道它是否是一個綜合指數,應該顯示在這裏,但該應用程序缺少索引,我卡住了。
任何幫助,非常感謝。
我有完全相同的問題。你找到解決方案嗎? –
這裏同樣的問題。有沒有人有辦法解決嗎? – DFB
我設法解決了這個問題,並在下面發佈了我的解決方案。 – DFB