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.

Was this helpful?

Thanks for your feedback!

Why was this unhelpful?

Have a question about this article?

See questions about this article

Powered by Confluence and Scroll Viewport