NullPointerException in org.opennms.netmgt.config.NotificationCommandManager.getCommand

Description

org.opennms.netmgt.config.NotificationCommandManager.getCommand can throw a
NullPointerException if parseXML in the same class is not called or if it throws an exception while
executing this line:

Collection commands = ((NotificationCommands)
Unmarshaller.unmarshal(NotificationCommands.class, reader)).getCommandCollection();

Here's a stack trace from a user, tfischer@oldenburggroup.com. This is on OpenNMS 1.2.0. It is likely
that they have an invalid notificationCommand.xml file, which is another problem.

2005-06-28 14:13:44,532 ERROR [Notifd:BroadcastEventProcessor]
BroadcastEventProcessor: notice not scheduled due to error:
java.lang.NullPointerException
at
org.opennms.netmgt.config.NotificationCommandManager.getCommand(Notification
CommandManager.java:83)
at
org.opennms.netmgt.notifd.BroadcastEventProcessor.makeUserTask(BroadcastEven
tProcessor.java:651)
at
org.opennms.netmgt.notifd.BroadcastEventProcessor.processTargets(BroadcastEv
entProcessor.java:594)
at
org.opennms.netmgt.notifd.BroadcastEventProcessor.scheduleNoticesForEvent(Br
oadcastEventProcessor.java:417)
at
org.opennms.netmgt.notifd.BroadcastEventProcessor.onEvent(BroadcastEventProc
essor.java:169)
at
org.opennms.netmgt.eventd.EventIpcManagerDefaultImpl$ListenerThread.run(Even
tIpcManagerDefaultImpl.java:169)
at java.lang.Thread.run(Thread.java:534)

Environment

Operating System: All Platform: All

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Seth Leger (community account) April 7, 2010 at 4:07 PM

I can't find any indication in the code that Notifd could start successfully with a malformed config file; it should throw an UndeclaredThrowableException as soon as Castor fails to parse the file. I'm assuming this was fixed long ago, marking that way.

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

PagerDuty

Created June 28, 2005 at 3:16 PM
Updated January 27, 2017 at 4:32 PM
Resolved April 7, 2010 at 4:07 PM