title: java.lang.NoSuchMethodError: com.sun.mail.util.TraceInputStream
body: <p>I'm trying to send an email through Java Mail API and it works fine on my laptop. When I'm doing exactly the same in Heroku, I'm getting this:</p>
  
  <pre><code>java.lang.NoSuchMethodError: com.sun.mail.util.TraceInputStream.(Ljava/io/InputStream;Lcom/sun/mail/util/MailLogger;)V
      at com.sun.mail.smtp.SMTPTransport.initStreams(SMTPTransport.java:2014)
      at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1936)
      at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:654)
      at javax.mail.Service.connect(Service.java:291)
      at ...
  </code></pre>
  
  <p>Here is what I have in <code>pom.xml</code>:</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;javax.mail&lt;/groupId&gt;
          &lt;artifactId&gt;mailapi&lt;/artifactId&gt;
          &lt;version&gt;1.4.3&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;com.sun.mail&lt;/groupId&gt;
          &lt;artifactId&gt;javax.mail&lt;/artifactId&gt;
          &lt;version&gt;1.5.3&lt;/version&gt;
          &lt;scope&gt;runtime&lt;/scope&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>I guess there is another version of Java Mail API inside Heroku JDK, which doesn't have this constructor... How can this be fixed?</p>