Migration to JDK 11 has error occure “java.lang.NoClassDefFoundError: javax/activation/DataSource” (tomcat 9.0.12) [duplicate]

依然范特西╮ 提交于 2019-11-29 14:04:18

You seem to have included an incorrect artifact(external jar).

You should include javax.activation:javax.activation-api:1.2.0 as an external dependency to your project to explicitly access the class javax.activation.DataSource. Sample maven dependency for the same would be:

<dependency>
  <groupId>javax.activation</groupId>
  <artifactId>javax.activation-api</artifactId>
  <version>1.2.0</version>
</dependency>

Also, note if using modularised code (includes module-info.java), you must state a dependence on the library using declaration -

requires java.activation;
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!