Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-7549

NPE on admin/notification/noticeWizard/chooseUeis.jsp

    XMLWordPrintable

    Details

      Description

      For some reason the fix for NMS-6821 is breaking the notification wizard under certain circumstances:

      2015-03-11 08:30:02,116 WARN  [qtp1282901159-911634 - /opennms/admin/notification/noticeWizard/chooseUeis.jsp] o.e.j.s.ServletHandler:
      org.apache.jasper.JasperException: java.lang.NullPointerException
          at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432) ~[org.apache.jasper.glassfish-2.1.0.v201110031002.jar:?]
          at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:476) ~[org.apache.jasper.glassfish-2.1.0.v201110031002.jar:?]
          at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:366) ~[org.apache.jasper.glassfish-2.1.0.v201110031002.jar:?]
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) ~[javax.servlet-2.5.0.v201103041518.jar:?]
          at org.eclipse.jetty.servlet.JspPropertyGroupServlet.service(JspPropertyGroupServlet.java:132) ~[jetty-servlet-7.6.15.v20140411.jar:7.6.15.v20140411]
          at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:652) ~[jetty-servlet-7.6.15.v20140411.jar:7.6.15.v20140411]
          at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1317) ~[jetty-servlet-7.6.15.v20140411.jar:7.6.15.v20140411]
          at org.opennms.container.web.felix.base.internal.dispatch.InvocationFilterChain.doFilter(InvocationFilterChain.java:53) ~[?:?]
          at org.opennms.container.web.felix.base.internal.dispatch.HttpFilterChain.doFilter(HttpFilterChain.java:35) ~[?:?]
          at org.opennms.container.web.felix.base.internal.dispatch.FilterPipeline.dispatch(FilterPipeline.java:50) ~[?:?]
          at org.opennms.container.web.felix.base.internal.dispatch.Dispatcher.dispatch(Dispatcher.java:42) ~[?:?]
          at org.opennms.container.web.bridge.internal.DispatcherFilter.doFilter(DispatcherFilter.java:72) ~[?:?]
      

      I figured out that the JSP assumes that the logMsg of an event is always not null, but the customer who has experiencing the problem has verified that the following fix has solved the NPE:

      diff --git a/opennms-webapp/src/main/webapp/admin/notification/noticeWizard/chooseUeis.jsp b/opennms-webapp/src/main/webapp/admin/notification/noticeWizard/chooseUeis.jsp
      index 9483437..f9e3901 100644
      --- a/opennms-webapp/src/main/webapp/admin/notification/noticeWizard/chooseUeis.jsp
      +++ b/opennms-webapp/src/main/webapp/admin/notification/noticeWizard/chooseUeis.jsp
      @@ -240,7 +240,7 @@ $(document).ready(function() {
            }
       
            public boolean isDisappearingEvent(Event e) {
      -         if ("donotpersist".equalsIgnoreCase(e.getLogmsg().getDest())) {
      +         if (e.getLogmsg() != null && "donotpersist".equalsIgnoreCase(e.getLogmsg().getDest())) {
                    return true;
                }
                if (e.getAlarmData() != null && e.getAlarmData().getAutoClean() == true) {
      

        Attachments

          Activity

            People

            Assignee:
            agalue Alejandro Galue
            Reporter:
            agalue Alejandro Galue
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: