I have followed multiple links and still can not get the smtp connection to work. I have a jira docker published by atlassian. I have tried JNDI configuration with the following
<Resource name="mail/SmtpServer"
auth="Container"
type="javax.mail.Session"
mail.smtp.host="ericstuck.com"
mail.smtp.port="587"
mail.transport.protocol="smtp"
mail.smtp.auth="true"
mail.smtp.user="eric@ericstuck.com"
password="***********"
mail.smtp.starttls.enable="true"
mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"
/>
and still get the following
IllegalArgumentException: Mail server at location [java:comp/env/mail/SmtpServer] is not of required type javax.mail.Session.
I have also seen that mail.x.x.x.jar and activation-1.1.1.jar
are not in the lib or /WEB-INF/lib.
Hello @Eric Stuck ,
The error you are encountering is described in the KB "Configuring an SMTP mail server to send notifications" under the section "Move the JavaMail Classes", notting:
Move the JavaMail Classes
You will also need to ensure that the JavaMail classes (typically in JAR library files) are present in your application server's classpath and that these do not conflict with Jira's JAR library files. This is necessary because the application server itself (not Jira) is establishing the SMTP connection and as such, the application server can not see the JAR library files in Jira's classloader.
Some operating systems may bundle the JavaMail classes with application servers (e.g. Tomcat in Red Hat Enterprise Linux). This may conflict with Jira's copy of the JavaMail classes, resulting in errors like:
java.lang.NoClassDefFoundError: javax/mail/Authenticator
or:
java.lang.IllegalArgumentException: Mail server at location [java:comp/env/mail/JiraMailServer] is not of required type javax.mail.Session.
Lighter application servers such as Apache Tomcat (including the one incorporated into the 'recommended' distributions of Jira), do not always come with JavaMail.
To prevent any conflicts, check your application server's
lib/
directory:
- If the application server already contains
mail-1.4.1.jar
andactivation-1.1.1.jar
, then just removemail-1.4.1.jar
andactivation-1.1.1.jar
from the<jira-application-dir>/WEB-INF/lib/
subdirectory of the Jira application installation directory.- If the application server does not contain
mail-1.4.1.jar
andactivation-1.1.1.jar
, then move themail-1.4.1.jar
andactivation-1.1.1.jar
from the<jira-application-dir>/WEB-INF/lib/
subdirectory of the Jira application installation directory into the thelib/
subdirectory of the Jira installation directory (for 'recommended' distributions of Jira) or thelib/
subdirectory of the application server running Jira.
But as you noted that mail.x.x.x.jar and activation-1.1.1.jar
are not in the lib or /WEB-INF/lib directory, I found another user discussing a similar issue in this thread:
They noted the solution in that case was to download the missing files from oracle directly and also removing the duplicate javax.<filename>.jar library in the Lib subdirectory as well.
Regards,
Earl
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.