我在谷歌應用程序引擎V1.7.0使用的EHCache 2.6.0編程方式(沒有ehcache.xml中)。GAE上的EHCache
當我實例的CacheManager使用:
CacheManager cacheManager = CacheManager.create();
我得到錯誤:
Caused by: java.lang.RuntimeException: java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers)
at java.util.concurrent.atomic.AtomicReferenceFieldUpdater$AtomicReferenceFieldUpdaterImpl.<init>(AtomicReferenceFieldUpdater.java:217)
at java.util.concurrent.atomic.AtomicRefe...(length 9029)
我想:
CacheManager cacheManager = new CacheManager();
,並與監測關:
Configuration configuration = new Configuration();
configuration.setMonitoring(Configuration.Monitoring.OFF.name());
configuration.setUpdateCheck(false);
CacheManager cacheManager = new CacheManager(configuration);
爲他們兩個我有以下錯誤:
Caused by: java.lang.NoClassDefFoundError: Could not initialize class net.sf.ehcache.util.lang.VicariousThreadLocal
at net.sf.ehcache.TransactionController.<init>(TransactionController.java:43)
at net.sf.ehcache.CacheManager.doInit(CacheManager.java:433)
at net.sf.ehcache.CacheManager.init(CacheManager.java:374)
如何解決這個問題?
但提供的EHCache GAE支持,請參閱[鏈接](http://ehcache.org/documentation/integrations/googleappengine) –
OK,在這種情況下,它似乎的EHCache包裝GAE緩存。但是,你需要適當的配置:http://ehcache.org/documentation/integrations/googleappengine#configuring-ehcachexml –
「兼容性 的Ehcache是兼容的,與谷歌應用程序引擎谷歌App Engine提供一個約束的運行制約網絡工程,線程和文件系統訪問「。 。網絡限制意味着它不會被分發。如果我錯了,請糾正我! –