# UnsupportedDataTypeException when trying to send email

**URL:** <https://discuss.elastic.co/t/unsupporteddatatypeexception-when-trying-to-send-email/28634>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [September 3, 2015, 6:27pm UTC](https://discuss.elastic.co/t/unsupporteddatatypeexception-when-trying-to-send-email/28634 "2015-09-03T18:27:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![graham\_](https://avatars.discourse-cdn.com/v4/letter/g/c37758/32.png) [@graham\_](https://discuss.elastic.co/u/graham_)\
**Post date:** [September 3, 2015, 6:27pm UTC](https://discuss.elastic.co/t/unsupporteddatatypeexception-when-trying-to-send-email/28634/1 "2015-09-03T18:27:45Z")

</div>

On 2.0.0-beta1

[ERROR][org.elasticsearch.watcher.actions.email] [Morbius] failed to execute action [log\_error\_watch/send\_email]  
javax.mail.MessagingException: failed to send email with subject [Airphrame Error] via account [airphrame];  
nested exception is:  
javax.mail.MessagingException: IOException while sending message;  
nested exception is:  
javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed;  
boundary="----=\_Part\_64\_1471161497.1441304800575"  
at org.elasticsearch.watcher.actions.email.service.InternalEmailService.send(InternalEmailService.java:85)  
at org.elasticsearch.watcher.actions.email.service.InternalEmailService.send(InternalEmailService.java:77)  
at org.elasticsearch.watcher.actions.email.ExecutableEmailAction.execute(ExecutableEmailAction.java:67)  
at org.elasticsearch.watcher.actions.ActionWrapper.execute(ActionWrapper.java:106)  
at org.elasticsearch.watcher.execution.ExecutionService.executeInner(ExecutionService.java:381)  
at org.elasticsearch.watcher.execution.ExecutionService.execute(ExecutionService.java:273)  
at org.elasticsearch.watcher.execution.ExecutionService$WatchExecutionTask.run(ExecutionService.java:419)  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)  
at java.lang.Thread.run(Thread.java:745)  
Caused by: javax.mail.MessagingException: IOException while sending message;  
nested exception is:  
javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed;  
boundary="----=\_Part\_64\_1471161497.1441304800575"  
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1245)  
at org.elasticsearch.watcher.actions.email.service.Account.send(Account.java:109)  
at org.elasticsearch.watcher.actions.email.service.InternalEmailService.send(InternalEmailService.java:83)  
... 9 more  
Caused by: javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed;  
boundary="----=\_Part\_64\_1471161497.1441304800575"  
at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:896)  
at javax.activation.DataHandler.writeTo(DataHandler.java:317)  
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1627)  
at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1849)  
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1196)  
... 11 more

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 4, 2015, 3:02am UTC](https://discuss.elastic.co/t/unsupporteddatatypeexception-when-trying-to-send-email/28634/2 "2015-09-04T03:02:08Z")

</div>

Is that the Watcher 2.0.0-beta1, or the ES one?

---

<div class="post-metadata">

**Author:** ![graham\_](https://avatars.discourse-cdn.com/v4/letter/g/c37758/32.png) [@graham\_](https://discuss.elastic.co/u/graham_)\
**Post date:** [September 4, 2015, 3:32am UTC](https://discuss.elastic.co/t/unsupporteddatatypeexception-when-trying-to-send-email/28634/3 "2015-09-04T03:32:18Z")

</div>

Elasticsearch 2.0.0-beta1  
Watcher 2.0.0-beta1

---

<div class="post-metadata">

**Author:** ![sudheerk](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@sudheerk](https://discuss.elastic.co/u/sudheerk)\
**Post date:** [September 10, 2015, 1:13pm UTC](https://discuss.elastic.co/t/unsupporteddatatypeexception-when-trying-to-send-email/28634/4 "2015-09-10T13:13:12Z")

</div>

Hi Graham-

I too got the similar error when my elasticsearch was 1.5 and trying to install the latest watcher plugin.  
I was able to get rid of that on another machine (Ubuntu) after installing the latest elasticsearch 1.7 and the latest watcher plugin.

[https://download.elastic.co/elasticsearch/license/license-latest.zip](https://download.elastic.co/elasticsearch/license/license-latest.zip)  
[https://download.elastic.co/elasticsearch/watcher/watcher-latest.zip](https://download.elastic.co/elasticsearch/watcher/watcher-latest.zip)

I followed the steps outlined in the below tutorial and was able to get the emails. The below link helped me a lot.

> **[Learn instant Log Analytics and reporting using Elasticsearch, Logstash and...](http://hadooptutorials.co.in/tutorials/elasticsearch/real-time-alerting-using-elasticsearch-watcher.html)**
>
> Generating real time alerts using ElasticSearch Watcher

Hope this helps.

Thanks  
sudheer

---

<div class="post-metadata">

**Author:** ![graham\_](https://avatars.discourse-cdn.com/v4/letter/g/c37758/32.png) [@graham\_](https://discuss.elastic.co/u/graham_)\
**Post date:** [September 14, 2015, 6:55pm UTC](https://discuss.elastic.co/t/unsupporteddatatypeexception-when-trying-to-send-email/28634/5 "2015-09-14T18:55:07Z")

</div>

I've tried this several times on a clean Ubuntu 14 with openjdk 8. 100% repro.  
My workaround is to move activation.jar and javax.mail.jar from plugins/watcher/lib to lib  
There is some sort of classloader issue going on here.

---

<div class="post-metadata">

**Author:** ![ppf2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppf2/32/52219_2.png) [@ppf2](https://discuss.elastic.co/u/ppf2)\
**Post date:** [September 24, 2015, 2:11am UTC](https://discuss.elastic.co/t/unsupporteddatatypeexception-when-trying-to-send-email/28634/6 "2015-09-24T02:11:27Z")

</div>

I have reproduced this on 2.x and filed an issue internally for tracking.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:48pm UTC](https://discuss.elastic.co/t/unsupporteddatatypeexception-when-trying-to-send-email/28634/7 "2017-07-06T13:48:32Z")

</div>


