Re: [objectify-appengine] (Beginner) Could not initialize ObjectifyService with Objectify 4.0b3 and Guice

1,464 views
Skip to first unread message

Jeff Schnitzer

unread,
May 13, 2013, 1:06:43 PM5/13/13
to objectify...@googlegroups.com

You need Google guava (as of 4.0b3). Check out the setup guide.

On May 13, 2013 10:05 AM, "Sébastien Vermeille" <sebastien...@gmail.com> wrote:
Hi there !

I'm learning how to use Objectify with my GWTP project. I'm sure that it works like a chief but I encounter some difficulties to make it working.

Here is what I did to install :

1) Download the latest jar from maven (objectify-4.0b3.jar) and I added it to my projet libraries (also in war/web-inf/lib)

2) Also downloaded guava-gwt-14.0.1.jar and added to both places

3) In my Project.gwt.xml :
added : 
<!-- Objectify -->
  <inherits name="com.googlecode.objectify.Objectify" />

4) In my Guice package class : DispatchServletModule extends ServletModule :

public class DispatchServletModule extends ServletModule {

@Override
public void configureServlets() {
serve("/" + ActionImpl.DEFAULT_SERVICE_NAME).with(DispatchServiceImpl.class);

// Objectify
filter("/*").through(ObjectifyFilter.class);
bind(ObjectifyFilter.class).in(Singleton.class);
}
}

And then I run the project.

It send me two errors :

first load : 

Reason:

    com/google/common/base/Function

Caused by:

java.lang.NoClassDefFoundError: com/google/common/base/Function
	at com.googlecode.objectify.cache.EntityMemcache.<init>(EntityMemcache.java:176)

after refresh :
 Could not initialize class com.googlecode.objectify.ObjectifyService

Caused by:

java.lang.NoClassDefFoundError: Could not initialize class com.googlecode.objectify.ObjectifyService
	at java.lang.Class.forName0(Native Method) 
	at java.lang.Class.forName(Unknown Source)

I know it's long... but could someone help me ? (I precise I tried with 1.7.7 and 1.8)

Thanks in advance for your help :) 

--
You received this message because you are subscribed to the Google Groups "objectify-appengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to objectify-appen...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Sébastien Vermeille

unread,
May 13, 2013, 1:18:44 PM5/13/13
to objectify...@googlegroups.com, je...@infohazard.org
Thank you for your answer Jeff.

So I used already guava-gwt-14.0.1.jar (i'm not using maven at the moment)
I based my setup on theses instructions : https://code.google.com/p/objectify-appengine/wiki/Setup

Do I have to make something special with guava in Guice or somewhere else like projet.gwt.xml ?

Thank you !
To unsubscribe from this group and stop receiving emails from it, send an email to objectify-appengine+unsub...@googlegroups.com.

Sébastien Vermeille

unread,
May 13, 2013, 4:17:17 PM5/13/13
to objectify...@googlegroups.com, je...@infohazard.org
YEAH ! I Found what was wrong ! I don't know if I am able to edit documentation so I write it there :

first of all it is important to say that people have to download guava-14.0.1.jar NOT gwt-guava-14.0.1.jar (Why ? don't know but it is important otherwise it doesn't works !)

I know maybe it can appear to be clear for you but I would really suggest to clarify it on the documentation for other users. (If I can help you just say it to me I can help to translate into french if you want)

Jeff Schnitzer

unread,
May 24, 2013, 2:26:39 AM5/24/13
to Vanitha R, objectify...@googlegroups.com
Doublecheck your classpath. If you're getting a NoClassDefFoundError on a guava class, that means you are missing the guava jar.

I added a note to the Setup document about the -gwt version of guava.

Jeff


On Thu, May 23, 2013 at 8:52 AM, Vanitha R <vanit...@gmail.com> wrote:
Hi All,

I am already using guava-14.0.1.jar but i still get the same error that you had mentioned. I am using Google app engine 1.8. Any suggestions?

Cheers,
Vanitha
Reply all
Reply to author
Forward
0 new messages