Bug 53027 - Jmeter starts throwing exceptions while using SMTP Sample in a test plan with HTTP Cookie Mngr or HTTP Request Defaults
Jmeter starts throwing exceptions while using SMTP Sample in a test plan with...
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: Main
2.6
All All
: P2 critical (vote)
: ---
Assigned To: JMeter issues mailing list
:
Depends on: 53042
Blocks:
  Show dependency tree
 
Reported: 2012-04-02 22:10 UTC by Elena
Modified: 2012-04-05 21:58 UTC (History)
1 user (show)



Attachments
JMeter test plan and log (2.02 KB, application/x-zip-compressed)
2012-04-02 22:10 UTC, Elena
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Elena 2012-04-02 22:10:50 UTC
Created attachment 28535 [details]
JMeter test plan and log

If a Test Plan contains (HTTP Request Defauls OR HTTP Cookie Manager) AND (SMTP Sampler), and you try to loop through it (run more than one iteration), SMTP Sampler will be executed only first time and then each following iteration JMeter throws following exceptions into the log:
ERROR - jmeter.threads.JMeterThread: Error while processing sampler 'SMTP Sampler - false' : java.lang.ClassCastException: org.apache.jmeter.testelement.property.NullProperty cannot be cast to org.apache.jmeter.testelement.property.CollectionProperty
	at org.apache.jmeter.protocol.smtp.sampler.SmtpSampler.sample(SmtpSampler.java:182)
	at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:416)
	at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:271)
	at java.lang.Thread.run(Unknown Source)

If you remove HTTP Request Defauls and HTTP Cookie Manager from the test - it works fine, calling SMTP Sample each iteration. The problem is exactly when these two elements presented in a Test Plan together.

Note: If you run the test only once, it works fine. If you run it manually several times in a row (i.e., clicking Run over and over again) - it works fine too. The problem occurs only when you either loop through the test inside a test plan, or when you specify "forever" or "run 10 times" or "run several minutes" kind of pattern in the thread.

I'm doing a web site availability and functionality check every 30 minutes, and need to send an email every time it succeeded or failed. So, I need my test plan constantly running and I need both HTTP Cookie Manager and SMTP Sampler - and this problem is really a blocker for me now.

Sample Test Plan attached (included only minimum necessary elements to reproduce the problem); jmeter.log file attached.

JMeter version: 2.6 (r1237317)
Java version: 1.6.0_16 (build 14.2-b01)
OS: Win XP 2002 sp3
Comment 1 Philippe Mouawad 2012-04-03 05:58:01 UTC
Hello,
Meanwhile you CAN use mailer visualiser in last nightly build to do what you want.
Regards
Philippe
Comment 2 Philippe Mouawad 2012-04-05 21:58:37 UTC
Date: Thu Apr  5 21:56:32 2012
New Revision: 1310093

URL: http://svn.apache.org/viewvc?rev=1310093&view=rev
Log:
Bug 53027 - Jmeter starts throwing exceptions while using SMTP Sample in a test plan with HTTP Cookie Mngr or HTTP Request Defaults

Modified:
   jmeter/trunk/src/protocol/mail/org/apache/jmeter/protocol/smtp/sampler/SmtpSampler.java
   jmeter/trunk/xdocs/changes.xml