Martijn Dashorst created ISPN-12100:
---------------------------------------
Summary: NPE when retrieving statistics
Key: ISPN-12100
URL:
https://issues.redhat.com/browse/ISPN-12100
Project: Infinispan
Issue Type: Bug
Components: Hibernate Cache, WildFly Server
Affects Versions: 9.4.18.Final
Reporter: Martijn Dashorst
When retrieving the statistics of infinispan caches I get a NullPointerException at the
following place:
{code:java}
java.lang.NullPointerException
at
org.infinispan@9.4.16.Final//org.infinispan.stats.impl.StatsImpl.<init>(StatsImpl.java:54)
at
org.infinispan@9.4.16.Final//org.infinispan.cache.impl.CacheImpl.getStats(CacheImpl.java:1405)
at
org.infinispan@9.4.16.Final//org.infinispan.cache.impl.AbstractDelegatingAdvancedCache.getStats(AbstractDelegatingAdvancedCache.java:301)
at
org.infinispan@9.4.16.Final//org.infinispan.stats.impl.CacheContainerStatsImpl.getStats(CacheContainerStatsImpl.java:617)
at
org.infinispan@9.4.16.Final//org.infinispan.stats.impl.CacheContainerStatsImpl.getRequiredMinimumNumberOfNodes(CacheContainerStatsImpl.java:138)
{code}
This is while accessing the statistics through the cachemanager through the code below:
{code:java}
@ApplicationScoped
public class InfinispanService {
@Resource(name = "java:comp/env/infinispan/hibernate/entity")
private Cache<?, ?> entityCache;
public void stats() {
EmbeddedCacheManager cacheManager = entityCache.getCacheManager();
cacheManager.getStats().getRequiredMinimumNumberOfNodes();
}
}
{code}
This is done in wildfly 19.0.1.Final, running using standalone.xml.
Obviously I'm digging into internals but probably this should not throw a NPE. The
workaround is of course not calling getRequiredMinimumNumberOfNodes() (as in this
particular case that is not configured IIUC).
--
This message was sent by Atlassian Jira
(v7.13.8#713008)