ObjectifyService.init() 方法未定义
ObjectifyService.init() method is undefined
我正尝试在 Eclipse 的 App Engine 项目中使用 Objectify
和 Cloud Tools SDK。 Objectify 的 GitHub wiki 的设置部分说:
Call ObjectifyService.init()
in the bootstrap of your application; a
servlet context listener is ideal.
我发现的每个教程或问题都说同样的事情,但 Eclipse 告诉我 ObjectifyService.init()
方法不存在。下面的代码来自 Objectify GitHub wiki。
public class Bootstrapper implements ServletContextListener {
public void contextInitialized(ServletContextEvent event) {
ObjectifyService.init(); //"The method init() is undefined for the type ObjectifyService"
ObjectifyService.register(MyClass.class);
}
@Override
public void contextDestroyed(ServletContextEvent sce) {
// TODO Auto-generated method stub
}
}
这个电话是不是不需要了?所有的教程,甚至看起来像官方文档的教程,都过时了吗?
您几乎可以肯定在您的类路径中包含了错误版本的 Objectify。确保只有 v6 版本。
我正尝试在 Eclipse 的 App Engine 项目中使用 Objectify
和 Cloud Tools SDK。 Objectify 的 GitHub wiki 的设置部分说:
Call
ObjectifyService.init()
in the bootstrap of your application; a servlet context listener is ideal.
我发现的每个教程或问题都说同样的事情,但 Eclipse 告诉我 ObjectifyService.init()
方法不存在。下面的代码来自 Objectify GitHub wiki。
public class Bootstrapper implements ServletContextListener {
public void contextInitialized(ServletContextEvent event) {
ObjectifyService.init(); //"The method init() is undefined for the type ObjectifyService"
ObjectifyService.register(MyClass.class);
}
@Override
public void contextDestroyed(ServletContextEvent sce) {
// TODO Auto-generated method stub
}
}
这个电话是不是不需要了?所有的教程,甚至看起来像官方文档的教程,都过时了吗?
您几乎可以肯定在您的类路径中包含了错误版本的 Objectify。确保只有 v6 版本。