Project: mule
Issue MULE-7848: VM fails in getSize() when log level = DEBUG
While trying to debug an issue with Batch I set the log level to "DEBUG" and this prevented the application from working at all. Attached you will find an application to reproduce it. Simply import the app in Studio, run it and hit the endpoint http://localhost:9000/test If you either remove the log4j.properties file or set the level to INFO it works fine. I checked the code and it's triggered from line 64 in org.mule.util.queue.DualRandomAccessFileQueueStoreDelegate: {code} if (logger.isDebugEnabled()) { logger.debug(String.format("Queue %s has %s messages", queueName, getSize())); } {code} This results into this when level = DEBUG: {code} java.lang.NullPointerException org.mule.util.queue.DualRandomAccessFileQueueStoreDelegate.size(DualRandomAccessFileQueueStoreDelegate.java:143) org.mule.util.queue.AbstractQueueStoreDelegate.getSize(AbstractQueueStoreDelegate.java:153) org.mule.util.queue.DualRandomAccessFileQueueStoreDelegate.(DualRandomAccessFileQueueStoreDelegate.java:66) {code}
Story points: 8