JMeter webservices NoClassDefFoundError: javax/mail

Using the JMeter Webservice(SOAP) request sampler requires the installation of mail.jar and activation.jar files. Those library files don't come with JMeter by default. Sending webservice requests without having these files results in an unexpected error. Many users don't know how to tackle this problem, though it's easy to fix.

If one sends a Webservice(SOAP) request with the default JMeter installation, an error is thrown: java.lang.NoClassDefFoundError: javax/mail/MessagingException. This error is visible both in Jmeter.log (located in the JMeter bin directory) and a result sampler like the View Results Tree.

The solution for this problem is to download and install the mail.jar and activiation.jar libraries. Download java mail from Sun and java activation from Sun. Extract respectively mail.jar and activiation.rar from the downloaded zip archives, and put them in your Jmeter lib folder. For instance: D:\machtst\My Documents\Tools\jakarta-jmeter-2.3.2\lib\

It's important to close JMeter and reopen it again, so JMeter can load the libraries. If you run your test again, the error should be gone.

Not the solution you were looking for? Check out the JMeter FAQ section for more JMeter solutions.

Related Posts by Categories


8 Responses to "JMeter webservices NoClassDefFoundError: javax/mail"

girlie said... October 21, 2009 at 10:52 AM

hi there,

wow! this follow up post after Tutorial on testing webservices with Apache JMeter is indeed very helpful...

however, i tried downloading java mail and activation jar files from sun and set it up as mentioned in your post, but the "java.lang.NoClassDefFoundError: javax/mail/MessagingException" is persisted.

did i miss something... i would appreciate your inputs on this one :)

by the way im using jmeter 2.3.4

thanks in advance,

Steven Machtelinckx said... October 21, 2009 at 11:07 AM


I'll do my best by asking you two questions first :-)

- Do you still get a java.lang.ClassNotFoundException or do you get another stacktrace now?

- Did you close and launch JMeter again?

There were my best shots for now. I hope to get a positive answer from you :-)

girlie said... October 21, 2009 at 12:12 PM

Hi Steven,

Thanks for the prompt reply :D

I figured out where I missed, I extracted the java mail and activation jar files in my BIN folder and not in my LIB folder.
Now its perfectly running.

Thanks for this post again :D


Steven Machtelinckx said... October 21, 2009 at 12:21 PM

Whoops, my bad. I pointed to a wrong folder in my post. I will update it right away.

I'm sorry for the inconvenience, thanks for having pointed out the error in my post :-)

Anonymous said... July 13, 2010 at 11:20 PM

thanks a lot, really helpful.


Anonymous said... June 20, 2012 at 10:02 AM

Your suggestion worked.., thanks to all

TestWithUs said... May 7, 2013 at 6:48 AM

SWIFT Interview questions on

For selenium solution visit

For QTP interview questions

glinius said... March 6, 2014 at 2:13 PM

Good guide on SOAP/REST Web Services testing using JMeter -

Post a Comment

Recent Articles

Top Commenters

Recent Comments