commons-user mailing list archives

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

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"),
							 mailConfig.getProperty("mail.smtpPassword"));
	email.setFrom			(fromAddress, fromName);
	email.setTo				(toAddresses);
	email.setSubject			(subject);
	email.setHtmlMsg			(htmlMessage);
	email.setTextMsg			(textMessage);
	email.send();

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(Email.java:749)
	at 
org.apache.commons.mail.MultiPartEmail.buildMimeMessage(MultiPartEmail.java:251)
	at org.apache.commons.mail.HtmlEmail.buildMimeMessage(HtmlEmail.java:229)
	at org.apache.commons.mail.Email.send(Email.java:897)
	at de.chrisbee.util.mail.Emailer.sendEmail(Emailer.java:83)
	at de.chrisbee.actions.OrderAction.submitOrder(OrderAction.java:885)
	at de.chrisbee.actions.OrderAction.nextStep(OrderAction.java:242)
	at de.chrisbee.actions.OrderAction.next6_onClick(OrderAction.java:144)
	... 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,
Ralf.

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


Mime
View raw message