Skip to main content



      Home
Home » Newcomers » Newcomers » JakartaMail / JavaMail: IOException: no data(IOException: no data when mail attachment larger than 64K)
JakartaMail / JavaMail: IOException: no data [message #1835826] Mon, 14 December 2020 08:07 Go to next message
Eclipse UserFriend
Hi guys,

We've been stuck on an issue that we're hoping you can help us out with. We have a custom workflow that converts .DAT files to PDF and sends an email with the PDF as attachment. The issue is when PDFs are larger than 65KB, we're seeing an IOException: no data when the javax.Mail.util.ByteArrayDataSource.getInputStream() is called. We're sending this mail through our corporate SMTP server. PDF sizes any smaller than 65KB are attached and emailed successfully.

Unfortunately we can't try a different SMTP Server such as Gmail because of our corporate network. I've tested using Telnet to send large attachments to our corporate SMTP server, and these are queued successfully.

I've read the documentation on JavaMail FAQ. We're using HtmlEmail API that uses MutlipartEmail. Hoping you can give us some direction, clues or tips on why we might be seeing "no data" when reading the stream?

There are 2 things we are yet to check with the SMTP team:
Is it possible they may have a "fetchsize" setting on the server.
Or they could have a 64KB limit on the header fields in a message file placed in the pickup directory

Here is the stack trace:
There was error while sending email for DAT file : XXXXXXXXXX, Error : org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtpau.xxxxxxx.xxxxxxxx.com:25
com.day.cq.mailer.MailingException: org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtpau.xxxxxxx.xxxxxxx.com:25
at com.day.cq.mailer.impl.DefaultMailService.send(DefaultMailService.java:302) [com.day.cq.cq-mailer:5.14.2]
at com.day.cq.mailer.impl.DefaultMailService.send(DefaultMailService.java:45) [com.day.cq.cq-mailer:5.14.2]
at com.xxxx.core.xml.SendEmailFormsWorkflow.sendEmail(SendEmailFormsWorkflow.java:327) [xxxx.core:1.1.0]
at com.xxxx.core.xml.SendEmailFormsWorkflow.processWorkflowContext(SendEmailFormsWorkflow.java:108) [xxxx.core:1.1.0]
at com.adobe.aemfd.watchfolder.workflow.WorkflowLauncherHandler.execute(WorkflowLauncherHandler.java:600) [adobe-aemds-core-watch-folder:3.0.46]
at com.xxxx.core.workflowprocesses.SendEmail.execute(SendEmail.java:62) [xxxx.core:1.1.0]
at com.adobe.granite.workflow.core.job.HandlerBase.executeProcess(HandlerBase.java:195) [com.adobe.granite.workflow.core:2.0.240.CQ650-B0014]
at com.adobe.granite.workflow.core.job.JobHandler.process(JobHandler.java:260) [com.adobe.granite.workflow.core:2.0.240.CQ650-B0014]
at org.apache.sling.event.impl.jobs.JobConsumerManager$JobConsumerWrapper.process(JobConsumerManager.java:502) [org.apache.sling.event:4.2.12]
at org.apache.sling.event.impl.jobs.queues.JobQueueImpl.startJob(JobQueueImpl.java:293) [org.apache.sling.event:4.2.12]
at org.apache.sling.event.impl.jobs.queues.JobQueueImpl.access$100(JobQueueImpl.java:60) [org.apache.sling.event:4.2.12]
at org.apache.sling.event.impl.jobs.queues.JobQueueImpl$1.run(JobQueueImpl.java:229) [org.apache.sling.event:4.2.12]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtpau.xxxxxxx.xxxxxxx.com:25
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1469) [org.apache.commons.email:1.5.0]
at org.apache.commons.mail.Email.send(Email.java:1496) [org.apache.commons.email:1.5.0]
at com.day.cq.mailer.impl.DefaultMailService.send(DefaultMailService.java:300) [com.day.cq.cq-mailer:5.14.2]
... 14 common frames omitted
Caused by: javax.mail.MessagingException: IOException while sending message
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1365) [com.sun.mail.javax.mail:1.6.2]
at javax.mail.Transport.send0(Transport.java:255) [com.sun.mail.javax.mail:1.6.2]
at javax.mail.Transport.send(Transport.java:124) [com.sun.mail.javax.mail:1.6.2]
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1459) [org.apache.commons.email:1.5.0]
... 16 common frames omitted
Caused by: java.io.IOException: no data
at javax.mail.util.ByteArrayDataSource.getInputStream(ByteArrayDataSource.java:157) [com.sun.mail.javax.mail:1.6.2]
at javax.activation.DataHandler.writeTo(DataHandler.java:318) [org.apache.sling.javax.activation:0.1.0]
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1694) [com.sun.mail.javax.mail:1.6.2]
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:996) [com.sun.mail.javax.mail:1.6.2]
at javax.mail.internet.MimeMultipart.writeTo(MimeMultipart.java:561) [com.sun.mail.javax.mail:1.6.2]
at com.sun.mail.handlers.multipart_mixed.writeTo(multipart_mixed.java:84) [com.sun.mail.javax.mail:1.6.2]
at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:897) [org.apache.sling.javax.activation:0.1.0]
at javax.activation.DataHandler.writeTo(DataHandler.java:330) [org.apache.sling.javax.activation:0.1.0]
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1694) [com.sun.mail.javax.mail:1.6.2]
at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1913) [com.sun.mail.javax.mail:1.6.2]
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1315) [com.sun.mail.javax.mail:1.6.2]
... 19 common frames omitted
Re: JakartaMail / JavaMail: IOException: no data [message #1835891 is a reply to message #1835826] Tue, 15 December 2020 17:53 Go to previous message
Eclipse UserFriend
This doesn't appear to have anything to do with Eclipse, and this isn't a general programming question board. You'd probably find a better audience for it at Java Ranch or Stack Overflow.
Previous Topic:Custom Plug-in - Capture the Mouse Right Click popup menu selection
Next Topic:cannot start tomcat 9 plugin
Goto Forum:
  


Current Time: Tue Jul 15 08:57:46 EDT 2025

Powered by FUDForum. Page generated in 0.08663 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top