0
我使用Google Apps Engine SDK 1.9.12在本地測試了一些代碼。我添加了一個servlet偵聽器,用2個名稱空間初始化memcache。我已經添加代碼的方法contextDestroyed(ServletContextEvent sce)
內清除內存緩存條目:未找到API包'memcache'或調用'FlushAll()'
MemcacheServiceFactory.getMemcacheService().clearAll();
這實際上引發以下異常,服務器宕機:
WARNING: EXCEPTION
com.google.apphosting.api.ApiProxy$CallNotFoundException: The API package 'memcache' or call 'FlushAll()' was not found.
at com.google.apphosting.api.ApiProxy$1.get(ApiProxy.java:179)
at com.google.apphosting.api.ApiProxy$1.get(ApiProxy.java:177)
at com.google.appengine.api.utils.FutureWrapper.get(FutureWrapper.java:88)
at com.google.appengine.api.memcache.MemcacheServiceImpl.quietGet(MemcacheServiceImpl.java:26)
at com.google.appengine.api.memcache.MemcacheServiceImpl.clearAll(MemcacheServiceImpl.java:170)
at com.valeo.general.util.BaseCacheManager.clearAll(BaseCacheManager.java:47)
at com.valeo.general.listeners.BaseCacheListener.contextDestroyed(BaseCacheListener.java:27)
at org.mortbay.jetty.handler.ContextHandler.doStop(ContextHandler.java:599)
at org.mortbay.jetty.webapp.WebAppContext.doStop(WebAppContext.java:505)
at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76)
at org.mortbay.jetty.handler.HandlerWrapper.doStop(HandlerWrapper.java:142)
at org.mortbay.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:76)
at com.google.appengine.tools.development.JettyContainerService.reloadWebApp(JettyContainerService.java:393)
at com.google.appengine.tools.development.JettyContainerService$2.filesChanged(JettyContainerService.java:380)
at org.mortbay.util.Scanner.reportBulkChanges(Scanner.java:486)
at org.mortbay.util.Scanner.reportDifferences(Scanner.java:352)
at org.mortbay.util.Scanner.scan(Scanner.java:280)
at org.mortbay.util.Scanner$1.run(Scanner.java:232)
at java.util.TimerThread.mainLoop(Unknown Source)
at java.util.TimerThread.run(Unknown Source)
請幫我解決這個問題。
你從哪裏得到這個例外?在App Engine上(生產)?或者在本地運行項目?應用程序引擎SDK jar是否添加到您的項目中? – icza 2014-10-09 07:48:55
我在本地使用它。 App Engine SDK 1.9.12 jar被添加到項目中。我正在使用Memcache API來設置值,它的工作原理。 – 2014-10-09 08:23:34