title: javax.mail no longer working with java 11 and tomcat 8.5
body: <p>I am using <code>java 11.0.4 2019-07-16 LTS</code> on <code>Ubunutu 18</code> and <code>Apache Tomcat 8.5</code>.</p>
  
  <p>I created a class for sending emails that imports </p>
  
  <pre><code>import javax.mail.*;
  import javax.mail.internet.*;
  </code></pre>
  
  <p>Now, when I used <code>java 8</code>I did not have any problems with sending my emails. However, now it does not work instead I am getting a 500 error.</p>
  
  <p>And having a look at my <code>localhost.2019-08-20.log</code> I can find the following stacktrace:</p>
  
  <pre><code>20-Aug-2019 17:13:14.961 SEVERE [http-nio-80-exec-96] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [mlc.servlets.DispatcherServlet] in context with path [] threw exception [Servlet execution threw an exception] with root cause
      java.lang.ClassNotFoundException: javax.activation.DataHandler
          at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1360)
          at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1182)
          at mlc.Mailer.sendEMail(Mailer.java:35)
          ...and so on...
  </code></pre>
  
  <p>Doing some research I think the problem is that the module <code>java.activation</code> is not loaded.</p>
  
  <p>However, I did not find any solution on the internet. I only found that <code>java.activation</code> has been removed from java 11. So, I guess I need something else.</p>
  
  <p>So, my questions: What do I have to do that my webapp can - again - send emails using Tomcat 8.5?</p>
  
  <p>Thanks</p>