sonatype / nexus-public

Sonatype Nexus Repository Open-source codebase mirror
https://www.sonatype.com/products/repository-oss-download
Eclipse Public License 1.0
1.83k stars 557 forks source link

[NEXUS-42267] Temurin Java 11: UnsupportedDataTypeException: no object DCH for MIME type text/plain; charset=us-ascii #374

Closed somera closed 2 months ago

somera commented 2 months ago

I updated to nexus-3.67.0-03-java11-unix.tar.gz and switched to temurin jdk-11.0.22+7-jre and I get this

2024-04-04 12:16:52,938+0200 WARN  [event-13-thread-5]  *SYSTEM org.sonatype.nexus.internal.scheduling.NexusTaskNotificationEmailSender - Failed to send email
org.apache.commons.mail.EmailException: Sending the email to the following server failed : xxx:587
        at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1469)
        at org.apache.commons.mail.Email.send(Email.java:1496)
        at org.sonatype.nexus.internal.email.EmailManagerImpl.send(EmailManagerImpl.java:197)
        at org.sonatype.nexus.internal.scheduling.NexusTaskNotificationEmailSender.sendEmail(NexusTaskNotificationEmailSender.java:101)
        at org.sonatype.nexus.internal.scheduling.NexusTaskNotificationEmailSender.on(NexusTaskNotificationEmailSender.java:88)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:85)
        at com.google.common.eventbus.Subscriber.lambda$dispatchEvent$0(Subscriber.java:71)
        at org.sonatype.nexus.thread.internal.MDCAwareRunnable.run(MDCAwareRunnable.java:40)
        at org.apache.shiro.subject.support.SubjectRunnable.doRun(SubjectRunnable.java:120)
        at org.apache.shiro.subject.support.SubjectRunnable.run(SubjectRunnable.java:108)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
Caused by: javax.mail.MessagingException: IOException while sending message
        at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1365)
        at javax.mail.Transport.send0(Transport.java:255)
        at javax.mail.Transport.send(Transport.java:124)
        at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1459)
        ... 16 common frames omitted
Caused by: javax.activation.UnsupportedDataTypeException: no object DCH for MIME type text/plain; charset=us-ascii
        at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:885)
        at javax.activation.DataHandler.writeTo(DataHandler.java:316)
        at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1694)
        at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1913)
        at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1315)
        ... 19 common frames omitted

error.

The nexus-3.67.0-03-java8-unix.tar.gz with temurin jdk8u402-b06/jre works fine.

Mykyta commented 2 months ago

Yes, I can reproduce it. @somera thanks for reporting. The ticket was created to fix it.

somera commented 2 months ago

@nblair how is here the status?

malaury-rio-fam commented 2 months ago

Hi, I encounter the same error (nexus 3.67.1-01, jdk Temurin-11.0.22+7, also with jdk Zulu11.72+19-CA). I tried to directly replace some libraries versions. I changed the version of apache commons-email to 1.6 (and the 2 dependencies javax.mail & activation) and now I can send email from nexus. This is only for testing and I think this is not a workaround, but maybe if this could help.

nblair commented 2 months ago

Hey all, we have a confirmed fix for this issue that will be included in 3.68.0, which is expected to be released on Tuesday May 7. Thanks for the suggested alternative @malaury-rio-fam, but our merged change doesn't rely the specific dependency upgrades you've mentioned.

somera commented 2 months ago

@nblair thx for the update. I can wait for the 3.68.0 release. Currently I run my nexus with Java 8.