This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 965350 - NPE in AlertManagerBean when RHQ starts up
NPE in AlertManagerBean when RHQ starts up
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: Alerts (Show other bugs)
4.5
Unspecified Unspecified
unspecified Severity unspecified (vote)
: ---
: RHQ 4.8
Assigned To: Heiko W. Rupp
Mike Foley
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-20 21:57 EDT by Elias Ross
Modified: 2013-09-11 05:52 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-09-11 05:52:30 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Elias Ross 2013-05-20 21:57:59 EDT
2013-05-21 01:37:04,470 WARN  [org.rhq.enterprise.server.alert.AlertManagerBean] MasterServerPluginContainer is not started yet
2013-05-21 01:37:04,470 ERROR [org.rhq.enterprise.server.alert.AlertManagerBean] Failed to send all notifications for Alert[id=64380]
java.lang.NullPointerException
        at org.rhq.enterprise.server.alert.AlertManagerBean.sendAlertNotifications(AlertManagerBean.java:679)
        at org.rhq.enterprise.server.alert.AlertManagerBean.fireAlert(AlertManagerBean.java:646)
        at sun.reflect.GeneratedMethodAccessor115.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
        at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
        at org.rhq.enterprise.server.common.PerformanceMonitorInterceptor.monitorHibernatePerformance(PerformanceMonitorInterceptor.java:32)
        at sun.reflect.GeneratedMethodAccessor88.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)



    public void sendAlertNotifications(Alert alert) {
        /*
         * make this method public in case we show the notification failure to the user in the UI in the future and want
         * to give them some way to explicitly try to re-send the notification for some client-side auditing purposes
         */
        try {
            if (log.isDebugEnabled()) {
                log.debug("Sending alert notifications for " + alert.toSimpleString() + "...");
            }
            List<AlertNotification> alertNotifications = alert.getAlertDefinition().getAlertNotifications();

            if (alertNotifications != null && alertNotifications.size() > 0) {
                AlertSenderPluginManager alertSenderPluginManager = getAlertPluginManager();

....

                        AlertSender<?> notificationSender = alertSenderPluginManager
                            .getAlertSenderForNotification(alertNotification);
                        if (notificationSender == null) {
                            notificationLog = new AlertNotificationLog(alert, senderName, ResultState.FAILURE,
                                "Failed to obtain a sender with given name");



getAlertPluginManager() can return null, causing trouble later on... At the very least this should be avoided. The plugin container should not try to send alerts when plugin manager is null.
Comment 1 Heiko W. Rupp 2013-06-19 09:50:24 EDT
master 6543f98
Comment 2 Heiko W. Rupp 2013-09-11 05:52:30 EDT
Bulk closing of old issues now that HRQ 4.9 is in front of the door.

If you think the issue has not been solved, then please open a new bug and mention this one in the description.

Note You need to log in before you can comment on or make changes to this bug.