Problem with Java SDK 1.7.1, java.lang.NoClassDefFoundError: Could not initialize class com.google.apphosting.api.DatastorePb$Query

1,133 views
Skip to first unread message

Emanuele Ziglioli

unread,
Aug 21, 2012, 9:26:59 PM8/21/12
to google-a...@googlegroups.com
I'm experiencing an exception with the new SDK. It looks like what's described in this old post:

java.lang.NoClassDefFoundError: Could not initialize class com.google.apphosting.api.DatastorePb$Query

Here's the API call that causes the error PreparedQuery.asIterable():

PreparedQuery p = getDatastore().prepare(query);
List<Entity> entities = new ArrayList<Entity>();
for (Entity entity : p.asIterable(FetchOptions.Builder.withChunkSize(CHUNK_SIZE))) {
entities.add(entity);
}

And the Stack Trace:

Problem accessing /. Reason:
tried to access class com.google.appengine.repackaged.com.google.common.base.Equivalences from class com.google.appengine.repackaged.com.google.common.collect.Interners$CustomInterner
Caused by:
java.lang.IllegalAccessError: tried to access class com.google.appengine.repackaged.com.google.common.base.Equivalences from class com.google.appengine.repackaged.com.google.common.collect.Interners$CustomInterner
at com.google.appengine.repackaged.com.google.common.collect.Interners$CustomInterner.<init>(Interners.java:77)
at com.google.appengine.repackaged.com.google.common.collect.Interners.newWeakInterner(Interners.java:118)
at com.google.appengine.repackaged.com.google.io.protocol.ProtocolSupport.<clinit>(ProtocolSupport.java:55)
at com.google.apphosting.api.DatastorePb$Query.<init>(DatastorePb.java:1248)
at com.google.apphosting.api.DatastorePb$Query$1.<init>(DatastorePb.java:2988)
at com.google.apphosting.api.DatastorePb$Query.<clinit>(DatastorePb.java:2988)
at com.google.appengine.api.datastore.QueryTranslator.convertToPb(QueryTranslator.java:28)
at com.google.appengine.api.datastore.PreparedQueryImpl.convertToPb(PreparedQueryImpl.java:181)
at com.google.appengine.api.datastore.PreparedQueryImpl.runQuery(PreparedQueryImpl.java:134)
at com.google.appengine.api.datastore.PreparedQueryImpl.asIterator(PreparedQueryImpl.java:66)
at com.google.appengine.api.datastore.BasePreparedQuery$1.iterator(BasePreparedQuery.java:26)
at org.vosao.dao.BaseDaoImpl.selectNotCache(BaseDaoImpl.java:278)





Emanuele Ziglioli

unread,
Aug 21, 2012, 9:32:01 PM8/21/12
to google-a...@googlegroups.com
This is a different stack trace for the same error (not sure why I see different stack traces)

HTTP ERROR 500

Problem accessing /. Reason:

    Could not initialize class com.google.apphosting.api.DatastorePb$Query

Caused by:

java.lang.NoClassDefFoundError: Could not initialize class com.google.apphosting.api.DatastorePb$Query
	at com.google.appengine.api.datastore.QueryTranslator.convertToPb(QueryTranslator.java:28)
	at com.google.appengine.api.datastore.PreparedQueryImpl.convertToPb(PreparedQueryImpl.java:181)
	at com.google.appengine.api.datastore.PreparedQueryImpl.runQuery(PreparedQueryImpl.java:134)
	at com.google.appengine.api.datastore.PreparedQueryImpl.asIterator(PreparedQueryImpl.java:66)
	at com.google.appengine.api.datastore.BasePreparedQuery$1.iterator(BasePreparedQuery.java:26)
	at org.vosao.dao.BaseDaoImpl.selectNotCache(BaseDaoImpl.java:278)

Takashi Matsuo

unread,
Aug 21, 2012, 9:37:20 PM8/21/12
to google-a...@googlegroups.com

Hi Emanuele,

What is your app-id?


--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/l21MkBL5dZEJ.

To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.



--
Takashi Matsuo | Developers Advocate | tma...@google.com

Emanuele Ziglioli

unread,
Aug 21, 2012, 9:54:02 PM8/21/12
to google-a...@googlegroups.com
I haven't deployed it. I'm seeing this error on the development server

Takashi Matsuo

unread,
Aug 21, 2012, 10:00:19 PM8/21/12
to google-a...@googlegroups.com

Does cleaning the project solve the issue then?


To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/XRTN1U7wO-wJ.

To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.

Emanuele Ziglioli

unread,
Aug 21, 2012, 10:02:19 PM8/21/12
to google-a...@googlegroups.com
Hi Takashi,

I've deployed a non default version with SDK 1.7.1 and it's working on the production server. So this problem just affects the local environment
Cleaning the project doesn't seem to help

Takashi Matsuo

unread,
Aug 21, 2012, 10:18:49 PM8/21/12
to google-a...@googlegroups.com

Hi Emanuele,

So, you are using vosao[1], right? Have you asked developers of vosao about this issue? I'm not saying it's an issue in vosao's side, but just in case.
I'd appreciate it if you could file an issue within our issue tracker with a minimal reproducible code if you found the issue is in our SDK.

Thanks



To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/hsGReKEj20MJ.

To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.

Emanuele Ziglioli

unread,
Aug 21, 2012, 10:35:36 PM8/21/12
to google-a...@googlegroups.com
Vosao is no longer supported.
I'll see if I can create a small project with a reproducible problem.
All I know at this stage is that if I revert to the earlier 1.7.0 SDK the problem goes away.

Thanks,
Emanuele
Reply all
Reply to author
Forward
0 new messages