Mail server at location [java:comp/env/mail/GmailSmtpServer] is not of required type javax.mail.Session

Symptoms

When adding a JNDI setting to an email server (especially if you are connecting your instance to Gmail), the following error is displayed:

 

The mail settings you entered were not valid. Error thrown was: Mail server at location [java:comp/env/mail/GmailSmtpServer] is not of required type javax.mail.Session.

Cause

As explained on Configuring JIRA to send SMTP Email, you need to ensure that the files javax.mail-X.X.X.jar,  javax.mail-api-X.X.X.jar  and activation-X.X.jar exist only in the <JIRA_Install>/lib directory.

The error occurs if the files exist both in <JIRA-Install>/atlassian-JIRA/WEB-INF/lib and <JIRA_Install>/lib.

Resolution

Removing the duplicate files will solve the problem.

  1. Shutdown JIRA;
  2. Move (do not copy) javax.mail-X.X.X.jar, javax.mail-api-X.X.X.jar and activation-X.X.jar to <JIRA_Install>/lib. 
  3. Restart JIRA and attempt to reconfigure your mail server again.

 

Last modified on Sep 21, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.