【发布时间】:2012-07-17 09:35:02
【问题描述】:
对于这个例子 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/datastore-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 错误验证
那么我怎样才能得到这些索引呢?
其他问题>> 当我运行此代码并在 User 类中添加一些属性为
@Persistent (mappedBy = "userC")
public List<Contact> UserContacts =new ArrayList<Contact>();
并部署它,引擎为 UserContacts 创建索引但是由于新属性而出现异常 - 上面的相同错误无法为它们创建索引 -
【问题讨论】:
-
你错过了关闭。
-
我加了,还是一样的问题
-
转到管理控制台的“数据存储索引”部分,检查相关索引是否实际上正在“服务”。
标签: google-app-engine servlets jdo google-cloud-datastore datanucleus