Details
-
Support Request
-
Resolution: Answered
-
Low
-
None
-
6.3.3
Description
When plugin code creates a cache in a clustered environment with replicateAsynchronously() setting, a NPE is thrown. Strangely through, the second call succeeds and the cache can be used.
The code:
CacheSettings settings = new CacheSettingsBuilder().replicateAsynchronously().build(); cacheManager.getCache(cacheID, new MyLoader(), settings);
If replicateAsynchronously() is removed, everything works on the first time too.
The exception:
Exception in thread "ItemTrackerMonitor" java.lang.NullPointerException
at org.terracotta.context.extractor.ObjectContextExtractor.extractInstanceAttribute(ObjectContextExtractor.java:57)
at org.terracotta.context.extractor.ObjectContextExtractor.extract(ObjectContextExtractor.java:50)
at org.terracotta.context.ContextManager.getOrCreateTreeNode(ContextManager.java:129)
at org.terracotta.context.ContextManager.associate(ContextManager.java:114)
at org.terracotta.context.ContextManager.access$000(ContextManager.java:39)
at org.terracotta.context.ContextManager$1.withParent(ContextManager.java:64)
at net.sf.ehcache.constructs.EhcacheDecoratorAdapter.<init>(EhcacheDecoratorAdapter.java:68)
at net.sf.ehcache.constructs.blocking.BlockingCache.<init>(BlockingCache.java:93)
at net.sf.ehcache.constructs.blocking.BlockingCache.<init>(BlockingCache.java:106)
at net.sf.ehcache.constructs.blocking.SelfPopulatingCache.<init>(SelfPopulatingCache.java:58)
at com.atlassian.cache.ehcache.EhCacheManager$3.get(EhCacheManager.java:142)
at com.atlassian.cache.ehcache.EhCacheManager$3.get(EhCacheManager.java:136)
at com.atlassian.util.concurrent.ManagedLocks$ManagedLockImpl.withLock(ManagedLocks.java:303)
at com.atlassian.cache.ehcache.EhCacheManager.createComputingCache(EhCacheManager.java:135)
at com.atlassian.cache.impl.AbstractCacheManager.getCache(AbstractCacheManager.java:179)
at sun.reflect.GeneratedMethodAccessor79.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.atlassian.plugin.osgi.hostcomponents.impl.DefaultComponentRegistrar$ContextClassLoaderSettingInvocationHandler.invoke(DefaultComponentRegistrar.java:129)
at com.sun.proxy.$Proxy188.getCache(Unknown Source)
at sun.reflect.GeneratedMethodAccessor79.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.atlassian.plugin.osgi.bridge.external.HostComponentFactoryBean$DynamicServiceInvocationHandler.invoke(HostComponentFactoryBean.java:154)
at com.sun.proxy.$Proxy188.getCache(Unknown Source)
at com.almworks.jira.structure.services2g.itemtracker.AOBasedItemTracker$ProductionEnv.getCache(AOBasedItemTracker.java:746)
Attachments
Issue Links
- relates to
-
JRACLOUD-39763 NPE when initializing cache-api cache with replicateAsynchronously() setting
- Closed