Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

mail-1.4.1.jar not available for JNDI setup

Frank Schmitz February 2, 2018

I am following https://confluence.atlassian.com/adminjiraserver/configuring-jira-s-smtp-mail-server-to-send-notifications-938847638.html to set up outgoing email on JIRA 7.7.1 after in-place upgrading from 7.6.1 on 64-bit Suse Linux. I am using Gmail and JNDI. I am getting error "java.lang.NoClassDefFoundError: javax/mail/Authenticator" when doing a connection.

The solution described in the document is to "move the mail-1.4.1.jar and activation-1.1.1.jar from the <jira-application-dir>/WEB-INF/lib/ subdirectory of the JIRA application installation directory into the the lib/ subdirectory of the JIRA installation directory". However, file mail-1.4.1.jar doesn't exist in any of the JIRA directories (activation-1.1.1.jar does, though).

 

Where can I get the file or can someone advise another fix?

 

Additional information:

The alternative setup option to specify the parameters in the UI instead of the via JNDI works fine.

 

 

2 answers

0 votes
Frank Schmitz February 8, 2018

Hi @Thomas Deiler, as to why I used the "old" jar file: according to the document I followed, the aim was to get mail-1.4.1 working in /usr/JIRA/lib. It did after removing the duplicate javax library.

 

However, I have now replaced mail-1.4.1.jar with javax.mail-1.5.6.jar in /usr/JIRA/lib and that works fine, too.

 

Either I misunderstood the instructions or maybe the document needs updating. Anyway, it's working either way.

 

Cheers,

Frank

0 votes
Thomas Deiler
Community Champion
February 3, 2018

Dear @Frank Schmitz,

the mail implementation is done by Oracle. So it is save to download those files from their server and use it. It could be the license of this Jar, that Atlassian is not allowed to bundle it.

And by the way, if Jira is not demanding explicitly the version 1.4.1 you can take also a newer one.

So long

Thomas

Frank Schmitz February 3, 2018

Thanks, Thomas,

I downloaded the 1.4.1 version from Oracle and put the executable mail.jar into the /usr/JIRA/lib directory as mail-1.4.1.jar together with the activation-1.1.1.jar file as per the documentation. I also made sure that no other mail-*.jar or activation-1.1.1.jar files exist in other directories.

After restarting JIRA, now I am getting a different error when testing the connection in the UI:

"IllegalArgumentException: Mail server at location [java:comp/env/mail/JiraMailServer] is not of required type javax.mail.Session."

My server.xml looks as follows (authentication details masked):

...

<Context path="" docBase="${catalina.home}/atlassian-jira" reloadable="false" useHttpOnly="true">
                     
                    <Resource name="mail/JiraMailServer"
                        auth="Container"
                        type="javax.mail.Session"
                        mail.smtp.host="smtp.gmail.com"
                        mail.smtp.port="25"
                        mail.transport.protocol="smtp"
                        mail.smtp.auth="true"
                        mail.smtp.user="xxx@gmail.com"
                        password="xxx"
                        mail.smtp.starttls.enable="true"
                    />

...

 

Any ideas?

Thomas Deiler
Community Champion
February 4, 2018

Dear @Frank Schmitz,

I just googled the exception and found an article of Atlassian. It describes the same problem with Confluence.

Probably you can find someone else facing this problem, who got a solution.

If nothing helps, you can configure your local MDA to act as a proxy. The whole authentication is then done by the MDA. Jira connect just normal to localhost to send mails and the problem is gone.

This would avoid using Jira/Java mail implementation.

I have done same in a similar situation, where a scanner was not able to use SSL/TSL, just plain. So my MDA did the encryption part and everything worked fine.

So long

Thomas

Frank Schmitz February 4, 2018

Hi @Thomas Deiler,

I couldn't resolve the issue. I have switched back from JNDI to providing the connection parameters via the UI.

Thanks for your help.

Frank

Frank Schmitz February 7, 2018

Dear @Thomas Deiler,

I found the remaining issue eventually in the /usr/JIRA/logs/catalina.out log:

2018-02-08 10:56:57,568 JIRA-Bootstrap WARN      [o.twdata.pkgscanner.ExportPackageListBuilder] Package Scanner found duplicates for package 'javax.mail.search' with different versions. Files: javax.mail-1.5.6.jar and mail-1.4.1.jar
      '/usr/JIRA/atlassian-jira/WEB-INF/lib/javax.mail-1.5.6.jar'

 

I removed the javax file, switched the configuration back to JNDI and now the outgoing email gets send correctly.

 

Thanks again!

Frank

Thomas Deiler
Community Champion
February 8, 2018

@Frank Schmitz,

that sound's odd. The file is part of the Jira installation, you removed. The methods of mail-1.4.1 get overwritten by javax-mail. But why does Jira request for the old jar file? Or why is this recommended?

Are you sure, the whole mail functionally works now as before? Javax-mail was used by Jira, for sure!

So long

Thomas

Suggest an answer

Log in or Sign up to answer