Java 谷歌应用引擎-检索实体-503服务不可用(上传工作)

Java 谷歌应用引擎-检索实体-503服务不可用(上传工作),java,android,google-app-engine,google-cloud-datastore,Java,Android,Google App Engine,Google Cloud Datastore,我正在使用以下代码成功地将实体上载到Google App Engine: public class EndpointsTask extends AsyncTask<Void, Void, Void> { protected Void doInBackground(Void... params) { Entity entity = new Entity(); Entityendpoint.Builder builder = new E

我正在使用以下代码成功地将实体上载到Google App Engine:

    public class EndpointsTask extends AsyncTask<Void, Void, Void> {
    protected Void doInBackground(Void... params) {

        Entity entity = new Entity();

        Entityendpoint.Builder builder = new Entityendpoint.Builder(
                  AndroidHttp.newCompatibleTransport(), new JacksonFactory(),
                  null);

              builder = CloudEndpointUtils.updateBuilder(builder);
        Entityendpoint endpoint = builder.build();  
              try {
                  endpoint.insertEntity(entity).execute();
     }
无论使用何种组合,我总是会在指向getEntity或Listenty行时出现以下错误:

com.google.api.client.googleapis.json.GoogleJsonResponseException: 503 Service Unavailable
System.err(1301): {
System.err(1301):   "code" : 503,
W/System.err(1301):   "errors" : [ {
W/System.err(1301):     "domain" : "global",
W/System.err(1301):     "message" : "",
W/System.err(1301):     "reason" : "backendError"
W/System.err(1301):   } ],
W/System.err(1301):   "message" : ""
W/System.err(1301): }
W/System.err(1301):     at      com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
W/System.err(1301): atcom.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
W/System.err(1301):     at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:312)
W/System.err(1301):     at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1049)
W/System.err(1301):     at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:410)
W/System.err(1301):     at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:343)
W/System.err(1301):     at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:460)
W/System.err(1301):     at com.example.app.MainActivity$GetEntityList.doInBackground(MainActivity.java:304)
W/System.err(1301):     at com.example.app.MainActivity$GetEntityList.doInBackground(MainActivity.java:1)
W/System.err(1301):     at android.os.AsyncTask$2.call(AsyncTask.java:288)
W/System.err(1301):     at java.util.concurrent.FutureTask.run(FutureTask.java:237)
W/System.err(1301):     at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
W/System.err(1301):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
W/System.err(1301):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
W/System.err(1301):     at java.lang.Thread.run(Thread.java:841)
我在Google App Engine控制台上检查了long,显示的错误如下:

Uncaught exception from servlet
java.io.IOException: 

com.google.appengine.repackaged.org.codehaus.jackson.map.JsonMappingException:

You have just   attempted to access field "touchedUsernames" yet this field was not detached when you detached the   object. Either dont access this field, or detach it when detaching the object. (through reference chain: com.example.app.Entity["touchedUsernames"])
我仍在试图理解此错误消息。根据我的研究,上面在服务器上显示的日志与我的实体变量设置不正确有关

以下是它的定义:

@Entity
public class Entity {

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String title;
private String description;
private Blob bmp;
private String username;
private long touched;
private boolean obscene;


@ElementCollection private Set<String> touchedUsernames = new HashSet<String>(); 
@ElementCollection private Set<String> obsceneUsernames = new HashSet<String>(); 
@实体
公共类实体{
@身份证
@GeneratedValue(策略=GenerationType.AUTO)
私人长id;
私有字符串标题;
私有字符串描述;
私有Blob-bmp;
私有字符串用户名;
私人长时间接触;
私密、淫秽;
@ElementCollection私有集touchedUsernames=new HashSet();
@ElementCollection私有集obsceneUsernames=新HashSet();
我该如何更新上面的实体以消除错误


谢谢!

找到了答案!我必须使用@Basic注释而不是@ElementCollection

@Entity
公共类实体{

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String title;
private String description;
private Blob bmp;
private String username;
private long touched;
private boolean obscene;


@Basic private Set<String> touchedUsernames = new HashSet<String>(); 
@Basic private Set<String> obsceneUsernames = new HashSet<String>(); 
@Id
@GeneratedValue(策略=GenerationType.AUTO)
私人长id;
私有字符串标题;
私有字符串描述;
私有Blob-bmp;
私有字符串用户名;
私人长时间接触;
私密、淫秽;
@基本私有集touchedUsernames=new HashSet();
@基本私有集obsceneUsernames=新HashSet();
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String title;
private String description;
private Blob bmp;
private String username;
private long touched;
private boolean obscene;


@Basic private Set<String> touchedUsernames = new HashSet<String>(); 
@Basic private Set<String> obsceneUsernames = new HashSet<String>();