[infinispan-issues] [JBoss JIRA] Created: (ISPN-324) Cache.clear() raises a NPE if CahceMode is DIST_SYNC and NumOwners is set to 1

Marco Ferrante (JIRA) jira-events at lists.jboss.org
Wed Dec 30 14:57:30 EST 2009


Cache.clear() raises a NPE if CahceMode is DIST_SYNC and NumOwners is set to 1
------------------------------------------------------------------------------

                 Key: ISPN-324
                 URL: https://jira.jboss.org/jira/browse/ISPN-324
             Project: Infinispan
          Issue Type: Bug
    Affects Versions: 4.0.0.CR3
            Reporter: Marco Ferrante
            Assignee: Manik Surtani
            Priority: Minor


This fragment: 

       GlobalConfiguration gc = GlobalConfiguration.getClusteredDefault();
        Configuration config = new Configuration();
        config.setCacheMode(Configuration.CacheMode.DIST_SYNC);
        config.setNumOwners(1); // no redundancy
 
        CacheManager cacheManager = new DefaultCacheManager(gc, config);
        Cache cache = cacheManager.getCache();

        cache.put("key", "value");

        cache.clear();
        assert cache.isEmpty();

raises a NullPointerException at cache.clear() invokation.
It works correctly both using other cache modes (LOCAL, REPL and INVALIDATION) or avoiding to set config.setNumOwners to 1.

The stacktrace is:

java.lang.NullPointerException
        at org.infinispan.interceptors.DistributionInterceptor.isSingleOwnerAndLocal(DistributionInterceptor.java:317)
        at org.infinispan.interceptors.DistributionInterceptor.handleWriteCommand(DistributionInterceptor.java:276)
        at org.infinispan.interceptors.DistributionInterceptor.visitClearCommand(DistributionInterceptor.java:180)
        at org.infinispan.commands.write.ClearCommand.acceptVisitor(ClearCommand.java:58)
        at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
        at org.infinispan.interceptors.LockingInterceptor.visitClearCommand(LockingInterceptor.java:169)
        at org.infinispan.commands.write.ClearCommand.acceptVisitor(ClearCommand.java:58)
        at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
        at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:132)
 ....

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the infinispan-issues mailing list