Home  >  Article  >  Java  >  UnsupportedDataTypeException: Migrating from javax.mail to jakarta.mail

UnsupportedDataTypeException: Migrating from javax.mail to jakarta.mail

WBOY
WBOYOriginal
2024-09-03 11:37:31994browse

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.

The above is the detailed content of UnsupportedDataTypeException: Migrating from javax.mail to jakarta.mail. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Varargs and ambiguityNext article:Varargs and ambiguity