對於這個例子 LINK 我試圖做到這一點,但這種異常發生?如何處理數據存儲索引應用程序引擎?
com.google.appengine.api.datastore.DatastoreNeedIndexException: no matching index found.
The suggested index for this query is:
<datastore-index kind="Contact" ancestor="true" source="manual">
<property name="UserContacts_INTEGER_IDX" direction="asc"/>
</datastore-index>
我該如何手動編寫這些索引?我儘量讓WEB-INF /數據存儲,indexes.xml 在這個XML我寫:
<?xml version="1.0" encoding="utf-8"?>
<datastore-indexes autoGenerate="true">
<datastore-index kind="Contact" ancestor="true" source="manual">
<property name="UserContacts_INTEGER_IDX" direction="asc"/>
</datastore-index>
,但是當我要多多部署此錯誤阻止我繼續部署
在「將商店部署到Google」期間發生內部錯誤。 驗證XML錯誤
那麼我怎樣才能得到這些索引?
另一個問題>> 當我運行該代碼,並添加在用戶類的一些屬性
@Persistent (mappedBy = "userC")
public List<Contact> UserContacts =new ArrayList<Contact>();
和部署,發動機使但是對於UserContacts指標出現異常,由於新的屬性 - 上面的同樣的錯誤不能使索引給他們 -
您錯過了關閉 datastore-indexes>。 – 2012-07-17 16:42:07
我添加了它,但仍然是同樣的問題 – Start 2012-07-17 17:53:47
轉到管理控制檯的「數據存儲索引」部分,並檢查相關索引是否實際上是「正在服務」。 – 2012-07-19 07:44:10