Marcus Trenton
Marcus Trenton

Reputation: 13

Getting java.lang.NoSuchFieldError: usingExperimentalRuntime in GAE MemCache

Whenever I try to access MemCache I get a java.lang.NoSuchFieldError: usingExperimentalRuntime. No documentation on that field from what I can find. Is there some configuration option that I'm not aware of?

Here's the source code:

MemcacheService syncCache = MemcacheServiceFactory.getMemcacheService();
syncCache.setErrorHandler(ErrorHandlers.getConsistentLogAndContinue(Level.ALL));

Object cacheObject = syncCache.get("arbitrary");

That last line crashes with this error (partial stack trace up to my code):

Caused by: java.lang.NoSuchFieldError: usingExperimentalRuntime
        at com.google.appengine.api.memcache.MemcacheServicePb$MemcacheGetRequest.writeTo(MemcacheServicePb.java:1511)
        at com.google.appengine.repackaged.com.google.protobuf.AbstractMessageLite.toByteArray(AbstractMessageLite.java:41)
        at com.google.appengine.api.memcache.MemcacheServiceApiHelper.makeAsyncCall(MemcacheServiceApiHelper.java:97)
        at com.google.appengine.api.memcache.AsyncMemcacheServiceImpl.doGet(AsyncMemcacheServiceImpl.java:405)
        at com.google.appengine.api.memcache.AsyncMemcacheServiceImpl.getIdentifiable(AsyncMemcacheServiceImpl.java:422)
        at com.google.appengine.api.memcache.MemcacheServiceImpl.getIdentifiable(MemcacheServiceImpl.java:54)
        at com.myCode.CacheOrDbUtil.getUser(CacheOrDbUtil.java:27)

What makes this so strange is that the code was working last week, complete with unit tests using MemCache. Now they are failing. Of course I've tried undoing everything I've done, but without success:

Upvotes: 1

Views: 598

Answers (3)

ludo
ludo

Reputation: 234

Either stay with 1.9.48 (out of the box in the Cloud SDK for now, upgraded next week to 1.9.49) and make sure your pom.xml/gradle build files are all using 1.9.48, or use the standard appengine Maven plugin from https://github.com/GoogleCloudPlatform/appengine-maven-plugin

<plugin>
   <groupId>com.google.appengine</groupId>
   <artifactId>appengine-maven-plugin</artifactId>
   <version>1.9.49</version>
</plugin>

or equivalent Gradle plugin for AppEngine (not the Cloud SDK one..)

Upvotes: 2

Chad Brockman
Chad Brockman

Reputation: 1396

We had to push everything to 1.9.49 to get it to work. I'm not sure why Maven doesn't list it on the website yet...

It's there -- it's just not listed:

https://repo1.maven.org/maven2/com/google/appengine/appengine-api-1.0-sdk/1.9.49/appengine-api-1.0-sdk-1.9.49.jar

Upvotes: 1

Dima Vaserin
Dima Vaserin

Reputation: 1

Try to update appEngineVersion to 1.9.49

Upvotes: 0

Related Questions