"If a worker wants to do his job well, he must first sharpen his tools." - Confucius, "The Analects of Confucius. Lu Linggong"
Front page > Programming > UnsupportedDataTypeException: Migrating from javax.mail to jakarta.mail

UnsupportedDataTypeException: Migrating from javax.mail to jakarta.mail

Published on 2024-11-09
Browse:674

UnsupportedDataTypeException: Migrating from javax.mail to jakarta.mail

While migrating a simple SMTP mailer class from javax.mail to the current jakarta.mail, I ended up with the error

UnsupportedDataTypeException: no object DCH for MIME type ...

In various forums, some people suggested to write a custom DataHandler to support the missing MIME types in the newer Jakarta mail implementations.

Fortunately, the Java code does not need to be changed (despite the import changes).

After countless number of hours searching the Internet, I finally found the correct jar files to be used during runtime:

  • angus-activation-2.0.2.jar
  • angus-mail-2.0.3.jar
  • jakarta.activation-api-2.1.3.jar
  • jakarta.mail-api-2.1.3.jar

Hope this helps someone else.

Release Statement This article is reproduced at: https://dev.to/andybrunner/unsupporteddatatypeexception-migrating-from-javaxmail-to-jakartamail-2771?1 If there is any infringement, please contact [email protected] to delete it
Latest tutorial More>

Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.

Copyright© 2022 湘ICP备2022001581号-3