Skip to content

Not able to invoke cache.get or cache.put in a spring-boot application #749

Closed
@cap-1203

Description

@cap-1203

I have created an appengine project using spring-boot.

This is how my code looks like

try {
        CacheFactory cacheFactory = CacheManager.getInstance()
                .getCacheFactory();
        cache = cacheFactory.createCache(Collections.emptyMap());
        LOG.info("Cache Created");
        cache.put(key, value);
    } catch (CacheException ex) {
        LOG.error("cache exception encountered:{}", ex);
    }

This is the Exception I get

com.google.apphosting.api.ApiProxy$CallNotFoundException: Can't make API call memcache.Set in a thread that is neither the original request thread nor a thread created by ThreadManager

at com.google.apphosting.api.ApiProxy$CallNotFoundException.foreignThread(ApiProxy.java:800) ~[appengine-api-1.0-sdk-1.9.54.jar:na]

at com.google.apphosting.api.ApiProxy$1.get(ApiProxy.java:175) ~[appengine-api-1.0-sdk-1.9.54.jar:na]

at com.google.apphosting.api.ApiProxy$1.get(ApiProxy.java:172) ~[appengine-api-1.0-sdk-1.9.54.jar:na]

at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:89) ~[appengine-api-1.0-sdk-1.9.54.jar:na]

at com.google.appengine.api.memcache.MemcacheServiceImpl.quietGet(MemcacheServiceImpl.java:26) ~[appengine-api-1.0-sdk-1.9.54.jar:na]

at com.google.appengine.api.memcache.MemcacheServiceImpl.put(MemcacheServiceImpl.java:69) ~[appengine-api-1.0-sdk-1.9.54.jar:na]

at com.google.appengine.api.memcache.stdimpl.GCache.put(GCache.java:157) ~[appengine-api-1.0-sdk-1.9.54.jar:na]

I have used the following dependency

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions