You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by David Brown <da...@davidwbrown.name> on 2008/05/07 21:37:38 UTC

44802 MonitorHealthVisualizer.java enhancement

Hello Sebb, in my efforts to migrate the MailerVisualizer functionality in the MonitorHealthVisualier to a third tabbed pane I extended MailerVisualizer in a new class. Now, the application can't get past the method: modifyTestElement() (NullPointerException). When I click the Mailer Alerts tab in the MonitorHealthPane I get the following NullPointerException. If I click the Test Mail button I get the same Exception. Any and all help with this issue will be greatly appreciated. TIA and please advise, David.

public void modifyTestElement(TestElement c) {
		super.modifyTestElement(c);
		MailerModel mailerModel = ((MailerResultCollector) c).getMailerModel();
		mailerModel.setFailureLimit(failureLimitField.getText());
		mailerModel.setFailureSubject(failureSubjectField.getText());
		mailerModel.setFromAddress(fromField.getText());
		mailerModel.setSmtpHost(smtpHostField.getText());
		mailerModel.setSuccessLimit(successLimitField.getText());
		mailerModel.setSuccessSubject(successSubjectField.getText());
		mailerModel.setToAddress(addressField.getText());
		if (log.isDebugEnabled()) {
			log.debug("MonitorMailerPanel.modifyTestElement().TestElement: " + c.getName());
		}
	}

********************************************
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
	at org.apache.jmeter.visualizers.MonitorMailerPanel.modifyTestElement(MonitorMailerPanel.java:196)
	at org.apache.jmeter.visualizers.MonitorMailerPanel.stateChanged(MonitorMailerPanel.java:385)
********************************************

The instance variable mailerModel is returned non-Null and has the expected Mailer Attributes as input at the dialog window.

The method: modifyTestElement(TestElement c) is failing @ mailerModel.setFailureLimit(failureLimitField.getText().

If I shutdown the servlet container nothing happens which leads me to believe that there is no Listener for the method:

public void add(SampleResult sample)









------------------------------------------------------------------------------------
Yet some, not wise, go to the other side of the globe, to barbarous and unhealthy regions, and devote ten or twenty years, in that they may live,-that is, keep comfortably warm,- and die in New England at last. 

Henry David Thoreau - Walden - 1845
Yet some, not wise, go to the other side of the globe, to barbarous and unhealthy regions, and devote ten or twenty years, in that they may live,-that is, keep comfortably warm,- and die in New England at last. 

Henry David Thoreau - Walden - 1845


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org


Re: 44802 MonitorHealthVisualizer.java enhancement

Posted by sebb <se...@gmail.com>.
2008/5/7 David Brown <da...@davidwbrown.name>:
> Hello Sebb, in my efforts to migrate the MailerVisualizer functionality in the MonitorHealthVisualier to a third tabbed pane I extended MailerVisualizer in a new class. Now, the application can't get past the method: modifyTestElement() (NullPointerException). When I click the Mailer Alerts tab in the MonitorHealthPane I get the following NullPointerException. If I click the Test Mail button I get the same Exception. Any and all help with this issue will be greatly appreciated. TIA and please advise, David.
>

There's not a lot I can say, except that if you have got a decent IDE,
it should not be too difficult to use the debugging facilities to
trace the source of the NPE.

This is not something that can be done over e-mail...

>  public void modifyTestElement(TestElement c) {
>                 super.modifyTestElement(c);
>                 MailerModel mailerModel = ((MailerResultCollector) c).getMailerModel();
>                 mailerModel.setFailureLimit(failureLimitField.getText());
>                 mailerModel.setFailureSubject(failureSubjectField.getText());
>                 mailerModel.setFromAddress(fromField.getText());
>                 mailerModel.setSmtpHost(smtpHostField.getText());
>                 mailerModel.setSuccessLimit(successLimitField.getText());
>                 mailerModel.setSuccessSubject(successSubjectField.getText());
>                 mailerModel.setToAddress(addressField.getText());
>                 if (log.isDebugEnabled()) {
>                         log.debug("MonitorMailerPanel.modifyTestElement().TestElement: " + c.getName());
>                 }
>         }
>
>  ********************************************
>  Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
>         at org.apache.jmeter.visualizers.MonitorMailerPanel.modifyTestElement(MonitorMailerPanel.java:196)
>         at org.apache.jmeter.visualizers.MonitorMailerPanel.stateChanged(MonitorMailerPanel.java:385)
>  ********************************************
>
>  The instance variable mailerModel is returned non-Null and has the expected Mailer Attributes as input at the dialog window.
>
>  The method: modifyTestElement(TestElement c) is failing @ mailerModel.setFailureLimit(failureLimitField.getText().
>
>  If I shutdown the servlet container nothing happens which leads me to believe that there is no Listener for the method:
>
>  public void add(SampleResult sample)
>
>
>
>
>
>
>
>
>
>  ------------------------------------------------------------------------------------
>  Yet some, not wise, go to the other side of the globe, to barbarous and unhealthy regions, and devote ten or twenty years, in that they may live,-that is, keep comfortably warm,- and die in New England at last.
>
>  Henry David Thoreau - Walden - 1845
>  Yet some, not wise, go to the other side of the globe, to barbarous and unhealthy regions, and devote ten or twenty years, in that they may live,-that is, keep comfortably warm,- and die in New England at last.
>
>  Henry David Thoreau - Walden - 1845
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
>  For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org