admin管理员组

文章数量:1415111

When my server code runs in production it throws this error:

Caused by: java.lang.NoSuchMethodError: 'java.util.Hashtable com.sun.activation.registries.MailcapFile.getMailcapList(java.lang.String)'
    at javax.activation.MailcapCommandMap.createDataContentHandler(MailcapCommandMap.java:486)
    at javax.activation.DataHandler.getDataContentHandler(DataHandler.java:568)
    at javax.activation.DataHandler.getContent(DataHandler.java:501)
    at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1505)
    at javax.mail.internet.MimeMessage.updateHeaders(MimeMessage.java:2238)
    at javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:2198)
    at .simplejavamail.mailer.internal.SendMailClosure.executeClosure(SendMailClosure.java:68)
    at .simplejavamail.mailer.internal.AbstractProxyServerSyncingClosure.run(AbstractProxyServerSyncingClosure.java:56)`enter code here`
    at .simplejavamail.mailer.internal.MailerImpl.sendMail(MailerImpl.java:344)
    at .simplejavamail.mailer.internal.MailerImpl.sendMail(MailerImpl.java:330)

but when I run it locally there is no such issue. The dependencies are present when I look in the IDE (see screenshots). Am using Spring version 5.3.34, and Java version 11.

When my server code runs in production it throws this error:

Caused by: java.lang.NoSuchMethodError: 'java.util.Hashtable com.sun.activation.registries.MailcapFile.getMailcapList(java.lang.String)'
    at javax.activation.MailcapCommandMap.createDataContentHandler(MailcapCommandMap.java:486)
    at javax.activation.DataHandler.getDataContentHandler(DataHandler.java:568)
    at javax.activation.DataHandler.getContent(DataHandler.java:501)
    at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1505)
    at javax.mail.internet.MimeMessage.updateHeaders(MimeMessage.java:2238)
    at javax.mail.internet.MimeMessage.saveChanges(MimeMessage.java:2198)
    at .simplejavamail.mailer.internal.SendMailClosure.executeClosure(SendMailClosure.java:68)
    at .simplejavamail.mailer.internal.AbstractProxyServerSyncingClosure.run(AbstractProxyServerSyncingClosure.java:56)`enter code here`
    at .simplejavamail.mailer.internal.MailerImpl.sendMail(MailerImpl.java:344)
    at .simplejavamail.mailer.internal.MailerImpl.sendMail(MailerImpl.java:330)

but when I run it locally there is no such issue. The dependencies are present when I look in the IDE (see screenshots). Am using Spring version 5.3.34, and Java version 11.

Share Improve this question edited Feb 12 at 6:42 bartonstanley 1,32714 silver badges30 bronze badges asked Feb 11 at 12:45 Dmitrii FediushovDmitrii Fediushov 317 bronze badges 2
  • 1 Looks to me like you have two libraries that provide the same package com.sun.activation. If that is the case it is no surprise that you run into problems. – Robert Commented Feb 11 at 12:52
  • 1 You have both the 1.0.2 and the 1.2.2 version of the Activation library, it has changed coordinates/names a few times in its history. Exclude one of them (preferably, exclude the older one). – Mark Rotteveel Commented Feb 11 at 13:15
Add a comment  | 

1 Answer 1

Reset to default 1

I solved the problem just by updating these dependencies of the project to last version: simplejavaemail 8.12.4 and atlassian-renderer 9.0.3

Versions of atlassian-renderer artifact lower than 9.0.3 depends on javax.activation 1.0.2, method com.sun.activation.registries.MailcapFile.getMailcapList of this artifact returns Hashtable

Artifact atlassian-renderer 9.0.3 depends on javax.activation 1.1.1 in this version method returns Map

本文标签: