Issue Details (XML | Word | Printable)

Key: ERMA-1
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Matthew Kemp
Reporter: Matthew O'Keefe
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
ERMA

NullPointerException thrown when using TransactionMonitor

Created: 13/Sep/08 11:03 AM   Updated: 04/Dec/08 03:20 PM
Return to search
Component/s: None
Affects Version/s: 3.1-RC1
Fix Version/s: 3.1

Labels:


 Description  « Hide
From https://answers.launchpad.net/erma/+question/44131:

When I'm trying to use TransactionMonitor with the following code:

TransactionMonitor txnmonitor = new TransactionMonitor(getClass(), "sometexthere", MonitoringLevel.INFO);
...
txnmonitor.succeeded();
txnmonitor.done();

I get the following exception:

[MonitoringEngine:623] [class com.orbitz.monitoring.api.monitor.TransactionMonitor attributes={sequenceId=m, threadId=11768ab, createdAt=Thu Sep 04 15:11:07 WAT 2008, name=[some.secret.here]}level=INFO] will be processed by [com.orbitz.monitoring.lib.processor.AsyncMonitorProcessor@1cc4e47]
[MonitoringEngine:631] Throwable caught while processing [class com.orbitz.monitoring.api.monitor.TransactionMonitor attributes={sequenceId=m, threadId=11768ab, createdAt=Thu Sep 04 15:11:07 WAT 2008, name=[some.secret.here]}level=INFO]; application is unaffected:
java.lang.NullPointerException
at com.orbitz.monitoring.api.monitor.AbstractCompositeMonitor.getSerializableMomento(AbstractCompositeMonitor.java:97)
at com.orbitz.monitoring.lib.processor.AsyncMonitorProcessor.monitorCreated(AsyncMonitorProcessor.java:61)
at com.orbitz.monitoring.api.MonitoringEngine$1.processWithProcessor(MonitoringEngine.java:225)
at com.orbitz.monitoring.api.MonitoringEngine.handleMonitor(MonitoringEngine.java:629)
at com.orbitz.monitoring.api.MonitoringEngine.monitorCreated(MonitoringEngine.java:218)
at com.orbitz.monitoring.api.monitor.AbstractMonitor.init(AbstractMonitor.java:255)
at com.orbitz.monitoring.api.monitor.AbstractMonitor.<init>(AbstractMonitor.java:57)
at com.orbitz.monitoring.api.monitor.AbstractCompositeMonitor.<init>(AbstractCompositeMonitor.java:38)
at com.orbitz.monitoring.api.monitor.TransactionMonitor.<init>(TransactionMonitor.java:51)
at com.orbitz.monitoring.api.monitor.TransactionMonitor.<init>(TransactionMonitor.java:91)
[... some secret stack continuation ...]

The _childMonitors member seems to be null..

Cheers,
Jakub



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Matthew O'Keefe added a comment - 13/Sep/08 11:03 AM
from mkemp:

The reason the second case works is because you a directly supplying the LoggingMonitorProcessor versus going through the AsyncMonitorProcessor. The SimpleMonitorProcessorFactory normally calls startup/shutdown on every MonitorProcessor, but when you're using the AsyncMonitorProcessor it doesn't have a reference to LoggingMonitorProcessor. That fact that AsyncMonitorProcessor does not forward the startup/shutdown calls is a bug. For now just use the LoggingMonitorProcessor.


Doug Barth added a comment - 02/Dec/08 11:51 AM
+1. Fix in Github looks good to me.