i've been banging head on issue, , i'm tired of squishy sound.
i need configure javamail instance on tomcat platform. of course, not want hard-code connection parameters within war file, i've been attempting establish jndi configuration. however, receiving exception suggesting there classpath issue (caused by: java.lang.noclassdeffounderror: javax/mail/authenticator). here code:
<resource name="mail/session" auth="container" type="javax.mail.session" username="jpulcifer@gmail.com" password="camp1onelcap" mail.debug="true" mail.user="jpulcifer@gmail.com" mail.password="camp1onelcap" mail.transport.protocol="smtp" mail.smtp.host="smtp.gmail.com" mail.smtp.auth="false" mail.smtp.port="465" mail.smtp.starttls.enable="false"/> session mailsession = null; try { mailsession = initialcontext.dolookup("java:comp/env/mail/session");
i'm not sure do. i've read comments around copy mail.jar , activation.jar [tomcat_home]/lib, seems... awkward. plus, i'm not sure how in development environment (eclipse). can point me in right direction? i'm stuck here; doesn't seem difficult thing do, i'm proving wrong.
if you're not putting mail.jar in tomcat's lib directory, are putting it? should able put in web-inf/lib directory.