Mail server at location is not of required type javax.mail.Session

Still need help?

The Atlassian Community is here for you.

Ask the community

This article only applies to Atlassian's server products. Learn more about the differences between cloud and server.

Problem

The following error is displayed when adding a JNDI setting to an email server (especially if you are connecting your instance to Gmail). This is also commonly seen after an upgrade if you had JNDI configured for your email server.

The following appears in the atlassian-confluence.log:

An error has occurred with sending the test email:
java.lang.IllegalArgumentException: Mail server at location [java:comp/env/mail/GmailSMTPServer] is not of required type javax.mail.Session.

Cause

As explained on Setting Up a Mail Session for the Confluence Distribution, you need to ensure that you move (don't copy) mail-x.x.x.jar from <confluence-install>\confluence\WEB-INF\lib to <confluence-install>\lib (x.x.x. represents the version numbers on the jar files in your installation).

Don't leave a renamed backup of the jar files in \confluence\WEB-INF\lib. Even with a different file name, the files will still be loaded as long as it remains in the directory.

Workaround

Removing the duplicate file should solve the problem.

  1. Shutdown Confluence
  2. Delete the mail-x.x.x.jar from <confluence-install>\confluence\WEB-INF\lib
  3. Restart Confluence and attempt to reconfigure your mail server again.

Resolution

This is being tracked at in the following for a permanent resolution:  CONF-43358 - Getting issue details... STATUS

 

Last modified on Nov 2, 2018

Was this helpful?

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