Hello,
I'm trying to send a mail with JavaMail. It was recently working fine.
But at this time, it doesn't work anymore. I'm having the following
error :
DEBUG: setDebug: JavaMail version 1.3.3
StandardWrapperValve[action]: "Servlet.service()" pour la servlet
action a généré une exception
java.lang.NoClassDefFoundError: javax/activation/DataSource
at
fr.swm.commun.service.technique.ServiceNotification.envoyerMailSMTP(ServiceNotification.java:55)
(...)
This error is thrown by the following instruction :
MimeMessage message = new MimeMessage(session);
The "activation.jar" library is present (it includes a
javax.activation.DataSource class), it is in classpath. (I tried to get
it out, and to put it back, but it doesn't work better...)
Here is my configuration : Eclipse 3.0.2, Tomcat 5.0.28, JavaMail
1.3.3_01, JAF 1.0.2
Thanks.
chrisrocker90@yahoo.com - 10 Feb 2006 20:02 GMT
Marine,
Take a look at the Tomcat startup script. I think it may overwrite the
system classpath. I always find it helpful to have a servelet display
the classpath.
Roedy Green - 10 Feb 2006 21:23 GMT
>NoClassDefFoundError
see http://mindprod.com/jgloss/caq.html
My guess is you recently upgraded your java and failed to refresh your
ext directories.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Marine - 15 Feb 2006 10:06 GMT
Thanks for your help.
In fact, I put activation.jar in the wrong place. I put it in the
application classpath (Eclipse -> Project properties), but Tomcat need
the library too, as I defined a mail Session in Tomcat, to get it by
JNDI.
So, I put activation.jar in C:\Program Files\Apache Software
Foundation\Tomcat 5.0\common\lib\ and yet, it is working well.
(Sorry for my bad english !)