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

Still need help?

The Atlassian Community is here for you.

Ask the community

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

Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles 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:

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:

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. 


Last modified on Jan 14, 2025

Was this helpful?

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