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.
and mail-api-X.X.X.jar
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.
- Shutdown JIRA;
Move (do not copy) javax.
mail-X.X.X.jar, javax.
andmail-api-X.X.X.jar
activation-X.X.jar
to<
.JIRA_Install>/lib
- Restart JIRA and attempt to reconfigure your mail server again.