java.io.IOException: Stream closed when trying to add a mail attachment in Fuse ESB 7.1

Solution Verified - Updated -

Issue

  • When trying to add a mail attachment in a Camel route deployed in Fuse ESB 7.1 the following exception occurs:
javax.mail.MessagingException: IOException while sending message;
  nested exception is:
    java.io.IOException: Stream closed
    at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1177)[98:javax.mail:1.4.5]
    at org.apache.camel.component.mail.DefaultJavaMailSender.send(DefaultJavaMailSender.java:124)[243:org.apache.camel.camel-mail:2.10.0.fuse-71-047]
    at org.apache.camel.component.mail.MailProducer.process(MailProducer.java:49)[243:org.apache.camel.camel-mail:2.10.0.fuse-71-047]
    at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:122)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:298)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:117)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.fabric.FabricTraceProcessor.process(FabricTraceProcessor.java:81)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:334)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:117)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:135)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:63)[149:org.apache.camel.camel-core:2.10.0.fuse-71-047]
    at java.util.TimerThread.mainLoop(Timer.java:555)[:1.7.0_13]
    at java.util.TimerThread.run(Timer.java:505)[:1.7.0_13]
Caused by: java.io.IOException: Stream closed
    at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:162)[:1.7.0_13]
    at java.io.BufferedInputStream.read(BufferedInputStream.java:325)[:1.7.0_13]
    at java.io.FilterInputStream.read(FilterInputStream.java:107)[:1.7.0_13]
    at javax.activation.DataHandler.writeTo(DataHandler.java:83)[96:org.apache.servicemix.specs.activation-api-1.1:2.0.0.fuse-71-047]
    at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1485)[98:javax.mail:1.4.5]
    at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:865)[98:javax.mail:1.4.5]
    at javax.mail.internet.MimeMultipart.writeTo(MimeMultipart.java:462)[98:javax.mail:1.4.5]
    at com.sun.mail.handlers.multipart_mixed.writeTo(multipart_mixed.java:103)[98:javax.mail:1.4.5]
    at javax.activation.DataHandler.writeTo(DataHandler.java:77)[96:org.apache.servicemix.specs.activation-api-1.1:2.0.0.fuse-71-047]
    at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1485)[98:javax.mail:1.4.5]
    at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1773)[98:javax.mail:1.4.5]
    at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1121)[98:javax.mail:1.4.5]

Environment

  • Fuse ESB 7.1
  • Camel 2.10.0.fuse-71-047

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In