Getting NullPointerException in MessageProcessor logs in Edge Private Cloud

We are observing NullPointerException very frequently in the Message Processor logs of our Private Cloud setup. There is no proper error/log msg for this failure.

Whenever this error occurs, API execution will stop at ratelimit (Quota/Spike Arrest), cache policy (LookupCache) or VerifyAPIKey policy throwing nullPointer exception but the policy does not fail.

org:<org-name> env:<env-name> api:<API-Name> rev:<rev-num> messageid:<message-id> policy:VK.VerifyAPIKey Apigee-Main-3 ERROR SERVICES.CACHE - DistributedCacheManagerImpl.getEntry() : DistributedCacheManagerImpl.getEntry() - exception when fetching entry <entry> - ignoring it....
java.lang.NullPointerException: null


org:<org-name> env:<env-name> api:<API-Name> rev:<rev-num> messageid:<message-id> policy:VK.VerifyAPIKey Apigee-Main-3 WARN SERVICES.CACHE - CacheManagerImpl.addEntry() : Exception when adding cache entry <entry> - ignoring it....
java.lang.NullPointerException: null
at com.apigee.cache.CacheMemoryLimiter.put(CacheMemoryLimiter.java:149)
at com.apigee.cache.EHEventListener.notifyElementPut(EHEventListener.java:58)
at net.sf.ehcache.event.RegisteredEventListeners.notifyListener(RegisteredEventListeners.java:294)
at net.sf.ehcache.event.RegisteredEventListeners.invokeListener(RegisteredEventListeners.java:284)
at net.sf.ehcache.event.RegisteredEventListeners.internalNotifyElementPut(RegisteredEventListeners.java:144)
at net.sf.ehcache.event.RegisteredEventListeners.notifyElementPut(RegisteredEventListeners.java:122)
at net.sf.ehcache.Cache.notifyPutInternalListeners(Cache.java:1481)

This will get resolved after restart of Message Processors but reappears again after sometime.

Solved Solved
0 1 860
1 ACCEPTED SOLUTION

The NullPointerException is caused due to lack of adequate cache memory in the Message Processor. This typically happens when the Java Heap is set to low values.

Ensure that recommended Java Heap settings are in place for the Message Processor as documented in this link.

If you don’t have the recommended Java Heap Settings at the minimum, then increase the Java Heap settings by following the instructions given in this link.

In our case, we increased the min and max Java Heap sizes from 512MB and 1GB to 3GB and 4GB respectively as shown below. This resolve the issue.

bin_setenv_min_mem=3072m
bin_setenv_max_mem=4096m

If you encounter the issue even after ensuring the recommended Java Heap settings are in place, then please contact Apigee Support.

View solution in original post

1 REPLY 1

The NullPointerException is caused due to lack of adequate cache memory in the Message Processor. This typically happens when the Java Heap is set to low values.

Ensure that recommended Java Heap settings are in place for the Message Processor as documented in this link.

If you don’t have the recommended Java Heap Settings at the minimum, then increase the Java Heap settings by following the instructions given in this link.

In our case, we increased the min and max Java Heap sizes from 512MB and 1GB to 3GB and 4GB respectively as shown below. This resolve the issue.

bin_setenv_min_mem=3072m
bin_setenv_max_mem=4096m

If you encounter the issue even after ensuring the recommended Java Heap settings are in place, then please contact Apigee Support.