hazelcast / hazelcast-hibernate

A distributed second-level cache for Hibernate
Other
44 stars 35 forks source link

NullPointerException in LocalRegionCache constructor #512

Open antonvovk opened 3 months ago

antonvovk commented 3 months ago

Describe the bug NullPointerException in LocalRegionCache constructor. We call createMessageListener() which may call maybeInvalidate() before the cache object is initialized.

Additional context Stacktrace:

2024-07-10 19:24:48,597 [hz.ENGINE-liveengine01.event-2] WARN  com.hazelcast.spi.impl.eventservice.EventService [ -  -   ()] [10.0.0.30]:5701 [live] [5.3.6] Error while logging processing event
java.lang.NullPointerException: Cannot invoke "java.util.concurrent.ConcurrentMap.get(Object)" because "this.cache" is null
        at com.hazelcast.hibernate.local.TimestampsRegionCache.maybeInvalidate(TimestampsRegionCache.java:90) ~[hazelcast-hibernate53-5.1.0.jar:5.1.0]
        at com.hazelcast.hibernate.local.LocalRegionCache.lambda$createMessageListener$0(LocalRegionCache.java:330) ~[hazelcast-hibernate53-5.1.0.jar:5.1.0]
        at com.hazelcast.topic.impl.TopicService.dispatchEvent(TopicService.java:151) ~[hazelcast-5.3.6.jar:5.3.6]
        at com.hazelcast.spi.impl.eventservice.impl.EventProcessor.process(EventProcessor.java:63) ~[hazelcast-5.3.6.jar:5.3.6]
        at com.hazelcast.spi.impl.eventservice.impl.RemoteEventProcessor.run(RemoteEventProcessor.java:48) ~[hazelcast-5.3.6.jar:5.3.6]
        at com.hazelcast.internal.util.executor.StripedExecutor$Worker.process(StripedExecutor.java:245) ~[hazelcast-5.3.6.jar:5.3.6]
        at com.hazelcast.internal.util.executor.StripedExecutor$Worker.run(StripedExecutor.java:228) ~[hazelcast-5.3.6.jar:5.3.6]