I need to fetch the Event that triggered a Notification. I have written an implementation of NotificationStrategy, which is correctly invoked by notifd. The notification places the eventId into the text message, which is included in the list of arguments passed to NotificationStrategy.send(). I log this information, so I am sure it is being received correctly.
My code then extracts the eventId, parses it into an integer, eid, and tries calling EventFactory.getEvent(eid). It gets to that point, but the call never returns. I catch SQLException, and that is not thrown either. I tried catching Throwable and found the problem to be java.lang.NoClassDefFoundError: org/opennms/web/event/EventFactory I am guessing this is caused by the EventFactory being loaded by a different classloader than my NotificationStrategy. This had me go look for another way to get the event, using the jars in lib and not web-apps. I was trying to learn more about the API and noticed that although http://www.opennms.org/documentation/java-apidocs-stable/ org/opennms/netmgt/xml/event/Event.html exists, if you go to the frame view, this class and its package are not in the list of packages and classes. I found that what I needed was org.opennms.netmgt.xml.event.Event, which I can get from org.opennms.netmgt.xml.event.NotificationFactory. This would have been easier to find if the Javadoc included that package. Also,having the Uses page when I am trying to learn an API. This lets me work backwards from what I want, in this case an Event. Once I have my whole task worked out, I'll write something up for the Wiki. If you could add to your (very long) ToDoList to check why the Javadoc is out of sync (and add Uses if possible), I know it would make things like this easier for me. Thanks for OpenNMS. Gary Levin RRC 1N345 Telcordia Technologies ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Please read the OpenNMS Mailing List FAQ: http://www.opennms.org/index.php/Mailing_List_FAQ opennms-devel mailing list To *unsubscribe* or change your subscription options, see the bottom of this page: https://lists.sourceforge.net/lists/listinfo/opennms-devel