Tag: objectify

为什么电子邮件,用户名,邮政编码等作为GAE数据存储区中的实体

我已经看到在GAE数据存储区中有这么多实体,最后是字符串,至少显然。 GAE Java数据存储实体列表 我想知道其中的原因是什么? 索引? 语义搜索?

使用Endpoints为Android设想

我读到Objectify是一个支持框架,用于端点。 如何从GPE App Engine Connected Android Project向导转换样本以处理Objectify 4数据? 我明白这个: org.datanucleus.exceptions.ClassNotPersistableException:类“com.example.MyObjectifyTestInfo”不可持久化。 这意味着它要么没有被增强,要么文件的增强版本不在CLASSPATH中(或者被未增强的版本隐藏),或者找不到类的元数据/注释。 我搜索了很多,但在stackoverflow或其他地方找不到任何东西。 谢谢。

Objectify和TimerTask:没有为此线程注册API环境

我正在尝试设置TimerTask以定期从Google App Engine的dataStore中删除条目。 所以我用Timer设置了一个ServletContextListener 。 在contextInitialized ,我已经注册了我的Objectify类: ObjectifyService.register(Person.class); 但是,当任务实际运行时,它会抱怨没有设置API环境: Exception in thread “Timer-0” java.lang.NullPointerException: No API environment is registered for this thread. at com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId(DatastoreApiHelper.java:80) at com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppIdNamespace(DatastoreApiHelper.java:90) at com.google.appengine.api.datastore.Query.(Query.java:214) at com.google.appengine.api.datastore.Query.(Query.java:143) at com.googlecode.objectify.impl.cmd.QueryImpl.(QueryImpl.java:72) at com.googlecode.objectify.impl.cmd.LoadTypeImpl.createQuery(LoadTypeImpl.java:50) at com.googlecode.objectify.impl.cmd.LoadTypeImpl.filter(LoadTypeImpl.java:58) at myApp.MyServletContextListener$MyTask.run(MyServletContextListener.java:58) at java.util.TimerThread.mainLoop(Timer.java:555) at java.util.TimerThread.run(Timer.java:505) 有任何想法吗? 我已经尝试将注册该类的行更改为ObjectifyService.factory().register(Person.class); 但它似乎没有帮助。

为什么API调用需要80毫秒的延迟才能到达控制器(在Google App Engine中)?

对于每个到达控制器的Api呼叫,它需要80ms的延迟,我已经尝试了所有的实例类,结果是一样的,我还没有找到任何解决方案。 如图所示,RPC调用从第80毫秒开始,剩余时间花在我的代码之外。

是否可以使用Java在Google App Engine上拥有计算属性?

我有一个应用程序引擎应用程序,我想运行一个查询,根据涉及两个属性的表达式对结果进行排序。 到目前为止,我想到的最好方法是创建一个计算/计算属性来存储该表达式的结果。 虽然我看到Python中的GAE提供了ComputedProperty,这似乎正是我正在寻找的,但我找不到Java中的等价物。 我现在也在使用Objectify,如果这有帮助的话。 有任何想法吗?

如何在Google App Engine Java上减少Appstats的内存使用量

这与Java Appengine APPSTATS问题导致java内存不足错误有关 。 Appstats似乎在128MB实例上导致java.lang.OutOfMemoryError,我想知道是否有办法减少日志记录量。 有没有办法从堆栈跟踪中过滤一些包名? GAE API: @14ms memcache.Get real=7ms api=0ms Stack: com.google.appengine.tools.appstats.Recorder:290 makeAsyncCall() com.google.apphosting.api.ApiProxy:184 makeAsyncCall() com.google.apphosting.api.ApiProxy:123 makeAsyncCall() com.google.appengine.api.memcache.MemcacheServiceApiHelper:104 makeAsyncCall() com.google.appengine.api.memcache.AsyncMemcacheServiceImpl:372 doGetAll() com.google.appengine.api.memcache.AsyncMemcacheServiceImpl:333 getIdentifiables() com.google.appengine.api.memcache.MemcacheServiceImpl:61 getIdentifiables() 我的appplication API: com.googlecode.objectify.cache.EntityMemcache:215 getAll() com.googlecode.objectify.cache.CachingAsyncDatastoreService:253 get() com.googlecode.objectify.cache.CachingDatastoreService:161 get() com.googlecode.objectify.cache.CachingDatastoreService:147 get() com.googlecode.objectify.cache.CachingDatastoreService:128 get() siena.gae.GaePersistenceManager:231 getByKey() siena.Model:106 getByKey() com.sirtrack.iridium.model.GroupEntity:147 getByKey() com.sirtrack.iridium.task.ProjectUpdateTask:49 doPost() 无关紧要的: javax.servlet.http.HttpServlet:637 service() javax.servlet.http.HttpServlet:717 service() org.mortbay.jetty.servlet.ServletHolder:511 handle() org.mortbay.jetty.servlet.ServletHandler$CachedChain:1166 […]

Google App Engine模块可以像Maven模块一样共享源代码吗?

我正在使用Google App Engine创建一个包含多个Google模块的项目。 如何设置我的项目(使用Maven)以便我可以跨模块共享诸如Objectify对象模型定义,共享实用程序代码和unit testing代码之类的源代码? 我希望答案很简单,我可以按照以下答案中的建议使用Maven: 你如何使用Maven分享两个项目的源代码? 如何在Eclipse中的多个项目中创建共享源文件夹? 对于测试代码: 在多模块maven项目中的模块之间共享src / test类 对于测试代码: 在maven项目之间共享测试资源 Eclipse链接资源: https : //stackoverflow.com/a/7585095/2848676 。 这与Maven兼容吗? 但是,我担心Google App Engine模块可能会有些特殊之处,这些模块与Maven模块不同。 然后也许上面的方法不起作用。 作为我担心的一个例子,请注意Google说“尽管Java EE支持WAR文件,但模块配置仅使用解压缩的WAR目录”。 但是上面给出的一些解决方案建议将共享代码打包到JAR文件中。 我意识到WAR和JAR是不同的,但我担心我会浪费时间尝试做一些不能做的工作。 有关如何在Google App Engine模块之间共享代码的任何建议?