Uploaded image for project: 'Cache Modules'
  1. Cache Modules
  2. MGNLCACHE-131

NullPointerExceptions from flush all caches.

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Neutral Neutral
    • 5.4.4
    • 5.4.3
    • cache core
    • None
    • Kromeriz 36
    • 1

      If cache is configured, but not yet used, and than I flush all caches this happens:

      2016-03-15 14:33:25,630 WARN  info.magnolia.module.cache.app.CacheToolsPresenter#flushAllCaches.144 Unable to flush all caches.
      java.lang.NullPointerException
      	at info.magnolia.module.cache.mbean.CacheMonitor.countFlush(CacheMonitor.java:123)
      	at info.magnolia.module.cache.ehcache.EhCacheWrapper.clear(EhCacheWrapper.java:155)
      	at info.magnolia.module.cache.commands.FlushCachesCommand.execute(FlushCachesCommand.java:67)
      	at info.magnolia.module.cache.app.CacheToolsPresenter.flushAllCaches(CacheToolsPresenter.java:141)
      	at info.magnolia.module.cache.app.CacheToolsViewImpl$4.buttonClick(CacheToolsViewImpl.java:209)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:508)
      	at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:198)
      	at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:161)
      	at com.vaadin.server.AbstractClientConnector.fireEvent(AbstractClientConnector.java:977)
      	at com.vaadin.ui.Button.fireClick(Button.java:393)
      	at com.vaadin.ui.Button$1.click(Button.java:61)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      
      

      I think it should simply never give a NPE there.

      Or if one insist that this situation is errorneous (which I doubt) it should throw some other exception, e.g. with information about which cache, which will be helpfull diagnosing the 'problem'.

        Acceptance criteria

              rkovarik Roman Kovařík
              mihxil Michiel Meeuwissen
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD