commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralf Schneider>
Subject Using commens-email from Tomcat application
Date Mon, 09 Apr 2007 12:59:01 GMT

I want to use Commons Email 1.0 from within a Tomcat web application (Tomcat 
5.5.20). I added commons-email-1.0.jar, mail.jar (Javamail 1.4) and 
activation.jar to the WEB-INF/lib directory. Here is a part of my code:

	HtmlEmail email=new HtmlEmail();
	email.setHostName		(mailConfig.getProperty("mail.smtpHost"));
	email.setAuthentication	(mailConfig.getProperty("mail.smtpUsername"),
	email.setFrom			(fromAddress, fromName);
	email.setTo				(toAddresses);
	email.setSubject			(subject);
	email.setHtmlMsg			(htmlMessage);
	email.setTextMsg			(textMessage);

Unfortunately, I get a NoClassDefFoundError with the last line:

Caused by: java.lang.NoClassDefFoundError: com/sun/mail/util/MailDateFormat
	at org.apache.commons.mail.Email.buildMimeMessage(
	at org.apache.commons.mail.HtmlEmail.buildMimeMessage(
	at org.apache.commons.mail.Email.send(
	at de.chrisbee.util.mail.Emailer.sendEmail(
	at de.chrisbee.actions.OrderAction.submitOrder(
	at de.chrisbee.actions.OrderAction.nextStep(
	at de.chrisbee.actions.OrderAction.next6_onClick(
	... 30 more

The class MailDateFormat is part of mail.jar. So the question is: Why is it 
not found? May there be a JAR file confict? Which are potential candidates 
for that?

Best regards,

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message