对于这个例子 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