Bug 643919 - Entering more than 3 Conditions on an alert gives a NPE
Summary: Entering more than 3 Conditions on an alert gives a NPE
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Alerts
Version: 3.0.0
Hardware: All
OS: All
low
medium vote
Target Milestone: ---
: ---
Assignee: RHQ Project Maintainer
QA Contact: Corey Welton
URL:
Whiteboard:
Depends On:
Blocks: jon241-bugs jon30-bugs
TreeView+ depends on / blocked
 
Reported: 2010-10-18 14:13 UTC by dsteigne
Modified: 2018-10-27 11:35 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)

Description dsteigne 2010-10-18 14:13:10 UTC
Description of problem:
If you enter more than 3 Conditions on an alert, when you try to save you get a NPE.

Version-Release number of selected component (if applicable):
2.4

How reproducible:


Steps to Reproduce:
1. Open an existing alert, add another condition, save
2. Open the same alert, add another condition, save
3. Open the same alert, add the 4 condition, save, the below error the thrown.
  
Actual results:
HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

java.lang.NullPointerException
	org.rhq.enterprise.gui.legacy.action.resource.common.monitor.alerts.config.condition.ConverterValidatorManager.validate(ConverterValidatorManager.java:102)
	org.rhq.enterprise.gui.legacy.action.resource.common.monitor.alerts.config.ConditionBean.validate(ConditionBean.java:311)
	org.rhq.enterprise.gui.legacy.action.resource.common.monitor.alerts.config.DefinitionForm.validate(DefinitionForm.java:666)
	org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.java:950)
	org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:207)
	org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
	org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	org.rhq.enterprise.gui.legacy.WebUserTrackingFilter.doFilter(WebUserTrackingFilter.java:50)
	org.rhq.enterprise.gui.legacy.AuthenticationFilter.doFilter(AuthenticationFilter.java:129)
	org.rhq.helpers.rtfilter.filter.RtFilter.doFilter(RtFilter.java:124)
	org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

note The full stack trace of the root cause is available in the JBossWeb/2.0.1.GA logs.



Expected results:


Additional info:

Comment 1 Lukas Krejci 2010-11-18 18:52:24 UTC
I was able to add more than 3 conditions without problem but got exactly the same exception as reported if I tried to save the alert without filling in the condition after clicking the "Add Another Condition" link. The below commit fixes that issue by showing an error message at the erroneous condition instead of throwing an unhandled exception.
 
commit 82f1c5a794362e72e14f3b3b64170cd75a7c12b1
Author: Lukas Krejci <lkrejci@redhat.com>
Date:   Thu Nov 18 19:47:23 2010 +0100

    BZ 643919 - Unspecified condition (that appears after clicking "Add Another Condition") doesn't cause an exception on alert saving. A proper error message appears instead.

Comment 2 Lukas Krejci 2010-11-18 18:53:12 UTC
Note that I didn't port this fix to the master branch because of the GUI overhaul that happens there anyway.

Comment 3 Corey Welton 2010-11-23 03:42:49 UTC
QA Verified - I am now able to add 3+ conditions, and per comment #1, was not able to repro the error when neglecting to fill in the conditions.

Comment 4 Corey Welton 2011-05-24 01:14:14 UTC
Bookkeeping - closing bug - fixed in recent release.

Comment 5 Corey Welton 2011-05-24 01:14:15 UTC
Bookkeeping - closing bug - fixed in recent release.

Comment 6 Corey Welton 2011-05-24 01:14:15 UTC
Bookkeeping - closing bug - fixed in recent release.


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