[MGNLCACHE-131] NullPointerExceptions from flush all caches. Created: 15/Mar/16  Updated: 24/Mar/16  Resolved: 24/Mar/16

Status: Closed
Project: Cache Modules
Component/s: cache core
Affects Version/s: 5.4.3
Fix Version/s: 5.4.4

Type: Improvement Priority: Neutral
Reporter: Michiel Meeuwissen Assignee: Roman Kovařík
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Sprint: Kromeriz 36
Story Points: 1

 Description   

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'.


Generated at Sun Feb 11 23:52:31 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.