Unable to Sent Mail Due to 'mail-1.x.jar' Conflict

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Symptoms

The following error appears when testing the mail connection:

1 HTTP Status 404 - Could not execute action [SendTestMail]:javax/mail/Authenticator<p><small><small><pre>java.lang.NoClassDefFoundError: javax/mail/Authenticator at org.apache.naming.factory.MailSessionFactory.getObjectInstance(MailSessionFactory.java:105) at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:140) at

Cause

Some operating systems may ship the JavaMail classes with application servers (eg. Tomcat in Red Hat Enterprise Linux). This may conflict with JIRA's copy of the JavaMail classes.

In Linux, you could check for the files by using the following command from your JIRA Home Directory and JIRA Installation Directory with the following commands:

1 2 find `pwd` -name *mail* find `pwd` -name *activation*

Resolution

To prevent any conflicts, check your application server's lib/ directory:

  1. If the application server already contains mail-1.4.1.jar and activation-1.1.1.jar, then just remove WEB-INF/lib/mail-1.4.1.jar and WEB-INF/lib/activation-1.1.1.jar from the JIRA webapp.

  2. If the application server does not contain mail-1.4.1.jar and activation-1.1.1.jar, then move JIRA's WEB-INF/lib/mail-1.4.1.jar and WEB-INF/lib/activation-1.1.1.jar into the application server's lib/ directory.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.