嗨,我刚开始使用 Google App Engine,这个错误超出了我的范围。
尝试将 Joda DataTime 与 Google App Engine 一起使用。我有一个拥有 dateTime 的实体,当它到达 em.close(); 时出现错误 错误显示“sentTime:org.joda.time.DateTime 不是受支持的属性类型。”
EntityManagerFactory emf = EMF.get();
EntityManager em = null;
try {
em = emf.createEntityManager();
List<Tasks> schedule = patients2.getTasks();
Tasks tasks = new Tasks();
String date = req.getParameter("dateTime")+":00.000-00:00"; DateTime sentTime = new DateTime (date);
tasks.setSentTime(sentTime);
schedule.add(tasks);
patients2.setTasks(schedule);
em.persist(patients2);
}
}
}finally {
if (em != null)
em.close();
}
堆栈跟踪是
WARNING: /CreateSchedule
java.lang.IllegalArgumentException: sentTime: org.joda.time.DateTime is not a supported property type.
at com.google.appengine.api.datastore.DataTypeUtils.checkSupportedSingleValue(DataTypeUtils.java:235)
at com.google.appengine.api.datastore.DataTypeUtils.checkSupportedValue(DataTypeUtils.java:207)
at com.google.appengine.api.datastore.DataTypeUtils.checkSupportedValue(DataTypeUtils.java:173)
at com.google.appengine.api.datastore.DataTypeUtils.checkSupportedValue(DataTypeUtils.java:148)
at com.google.appengine.api.datastore.PropertyContainer.setProperty(PropertyContainer.java:101)
at com.google.appengine.datanucleus.EntityUtils.setEntityProperty(EntityUtils.java:174)
at com.google.appengine.datanucleus.StoreFieldManager.storeFieldInEntity(StoreFieldManager.java:360)
at com.google.appengine.datanucleus.StoreFieldManager.storeObjectField(StoreFieldManager.java:190)
at org.datanucleus.state.AbstractStateManager.providedObjectField(AbstractStateManager.java:1447)
at healith.Tasks.jdoProvideField(Tasks.java)
at healith.Tasks.jdoProvideFields(Tasks.java)
at org.datanucleus.state.AbstractStateManager.provideFields(AbstractStateManager.java:1515)
at com.google.appengine.datanucleus.DatastorePersistenceHandler.insertObjectsInternal(DatastorePersistenceHandler.java:241)
at com.google.appengine.datanucleus.DatastorePersistenceHandler.insertObject(DatastorePersistenceHandler.java:218)
at org.datanucleus.state.JDOStateManager.internalMakePersistent(JDOStateManager.java:2381)
at org.datanucleus.state.JDOStateManager.flush(JDOStateManager.java:3778)
...