Java 更改数据类型是否会导致谷歌云出现一些问题?

Java 更改数据类型是否会导致谷歌云出现一些问题?,java,google-app-engine,google-cloud-storage,google-cloud-platform,Java,Google App Engine,Google Cloud Storage,Google Cloud Platform,好的,现在,我用这个代码部署我的应用程序 Entity entity=new Entity("StructureObject", structureObjectParentKey); String description=getData(); entity.setUnindexedProperty("Description",description); datastore.put(entity); 然后我在我的应用程序中插入一些数据(例如:“我爱你”,“好”),我可以毫无问题地获取数据 现在,

好的,现在,我用这个代码部署我的应用程序

Entity entity=new Entity("StructureObject", structureObjectParentKey);
String description=getData();
entity.setUnindexedProperty("Description",description);
datastore.put(entity);
然后我在我的应用程序中插入一些数据(例如:“我爱你”,“好”),我可以毫无问题地获取数据

现在,在我的
Description
属性
StructureObject
中,我有两个条目:“我爱你”,“好”,我可以访问它们(
retrieve?id=1
retrieve?id=2

现在,我将Eclipse中的代码更改为:

Entity entity=new Entity("StructureObject", structureObjectParentKey);
Text description=getData();
entity.setUnindexedProperty("Description",description);
datastore.put(entity);
现在我再插入两个条目“我爱你2”,“ok2”。现在,一件奇怪的事情发生了。我可以访问两个新条目“我爱你2”、“ok2”(
retrieve?id=3
retrieve?id=4
),但我无法检索(
retrieve?id=1
retrieve?id=2

这里是错误

    Uncaught exception from servlet
java.lang.ClassCastException: java.lang.String cannot be cast to com.google.appengine.api.datastore.Text
    at com.fluent.StructureObject.getStructureObject(StructureObject.java:138)
    at com.fluent.StructureServlet.doGet(StructureServlet.java:16)

更改数据类型是否会导致谷歌云出现一些问题?

在输入链接“检索?id=3”时,应该显示“我爱你2”,但在输入链接“检索?id=2”时更改代码后,显示错误!你能粘贴错误的内容吗?它在Google Cloud中,我不知道如何查看它。你应该能够访问云日志,其中myappname是你的云项目的名称。(您可能需要登录到拥有该项目的谷歌帐户)。明白了,似乎我遇到了数据类型问题!当输入链接“retrieve?id=3”时,应显示“我爱你2”,但在输入链接“retrieve?id=2”时更改代码后,显示错误!你能粘贴错误的内容吗?它在Google Cloud中,我不知道如何查看它。你应该能够访问云日志,其中myappname是你的云项目的名称。(您可能需要登录到拥有该项目的谷歌帐户)。明白了,似乎我遇到了数据类型问题!