Vikram Singh
Vikram Singh

Reputation: 1816

MemcacheServiceFactory class not found error after deploying to Google app engine (Java)

Everything works fine on local system but after deploying to Google App Engine, it throws the following error about Memcache. Is this because of any recent changes to GAE sdk?

com.google.apphosting.runtime.jetty9.JettyLogger warn: Error for /api/utilities (JettyLogger.java:29)
java.lang.NoClassDefFoundError: com/google/appengine/api/memcache/MemcacheServiceFactory
    at DataRetriever.getUtilitiesListJson(DataRetriever.java:29)

Upvotes: 2

Views: 312

Answers (3)

user1689987
user1689987

Reputation: 1546

My issue wasn't after deploying to app engine, just running locally. I needed these dependencies:

    <dependency>
        <groupId>javax.cache</groupId>
        <artifactId>cache-api</artifactId>
        <version>1.1.1</version>
    </dependency>

    <dependency>
        <groupId>com.google.appengine</groupId>
        <artifactId>appengine-api-1.0-sdk</artifactId>
        <version>1.9.80</version>
    </dependency>

Upvotes: 0

ludo
ludo

Reputation: 234

The issue is a disconnect between the new API jar version 1.9.77 and an old tooling stack. To update your tooling stack, make sure you have the latest GAE SDK Maven/Gradle plugins version, or Cloud SDK plugin version, as well as the latest Cloud SDK itself. For example, you need to run

gcloud components update

so that gcloud -version can show a java GAE version of 1.9.77 or above. But updating all tools (Plugins, SDKs, or IDE integrations) depending on what you use, you should be fine.

Upvotes: 0

marian.vladoi
marian.vladoi

Reputation: 8066

I found a related post Adam response.

This might help you:

"It sounds like you are missing the necessary App Engine JARs in your WEB-INF/lib directory in the WAR package that is being deployed.

If you are using the Google Plugin for Eclipse link I'd recommend creating a new Web Application project and try re-deploying, after ensuring that WEB-INF/lib contains the App Engine JARs.

If you are using Apache Maven link try creating a new project from the appengine-skeleton-archetype to ensure the necessary dependencies are specified in your pom.xml."

Upvotes: 1

Related Questions