Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Connecting Gsuite to Jira

Eric Stuck
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 17, 2020

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.  

1 answer

0 votes
Earl McCutcheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 25, 2020

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 and activation-1.1.1.jar, then just remove mail-1.4.1.jar and activation-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 and activation-1.1.1.jar, then move the mail-1.4.1.jar and activation-1.1.1.jar from the <jira-application-dir>/WEB-INF/lib/ subdirectory of the Jira application installation directory into the the lib/ subdirectory of the Jira installation directory (for 'recommended' distributions of Jira) or the lib/ 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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.11.0
TAGS
AUG Leaders

Atlassian Community Events