J Thom
J Thom

Reputation: 13

ObjectifyService.init() method is undefined

I am attempting to use Objectify in an App Engine project in Eclipse with the Cloud Tools SDK. The setup section of Objectify's GitHub wiki says:

Call ObjectifyService.init() in the bootstrap of your application; a servlet context listener is ideal.

Every tutorial or question I've found says the same thing, but Eclipse is telling me that the ObjectifyService.init() method doesn't exist. The code below comes from the 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

    }
}

Is this call no longer needed? Are all of the tutorials, even what looks like the official documentation, out of date?

Upvotes: 1

Views: 465

Answers (1)

stickfigure
stickfigure

Reputation: 13556

You have almost certainly included the wrong version of Objectify on your classpath. Make sure there is only the v6 version present.

Upvotes: 1

Related Questions