• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
no object DCH for MIME type application/pdf
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

no object DCH for MIME type application/pdf


  • Subject: no object DCH for MIME type application/pdf
  • From: John Baldwin <email@hidden>
  • Date: Thu, 20 Oct 2011 12:44:02 -0700

I'm trying to attach a pdf to an email and store it in an imap folder.

I can create and store the email, but I can't get the pdf attachment to work.

I get the error in the subject line.

Here's some exception output:

javax.mail.MessagingException: IOException while appending messages;
  nested exception is:
javax.activation.UnsupportedDataTypeException: no object DCH for MIME type application/pdf
at com.sun.mail.imap.IMAPFolder.appendMessages(IMAPFolder.java:1415)
at com.yourcompany.EmailAllReportsTask.performAction(EmailAllReportsTask.java:309)
at er.extensions.concurrency.ERXLongResponseTask$DefaultImplementation.run(ERXLongResponseTask.java:165)
at java.lang.Thread.run(Thread.java:680)
at er.extensions.concurrency.ERXLongResponseTask$WorkerThread.run(ERXLongResponseTask.java:63)
Caused by: javax.activation.UnsupportedDataTypeException: no object DCH for MIME type application/pdf

The error occurs when I try to add the message to the folder (the last line in this code sample) (yes, I'm going direct to the javamail apis at this point):

               ...
// Part two is attachment
                messageBodyPart = new MimeBodyPart();
                // DataSource source = new FileDataSource("smith");
                messageBodyPart.setContent(reportOutput, "application/pdf");
                messageBodyPart.setHeader("Content-Type", "application/pdf; name=\"ASuperPDF.pdf\"");
                messageBodyPart.setFileName("ASuperPDF.pdf");
                multipart.addBodyPart(messageBodyPart);

                // Put parts in message
                msg.setContent(multipart);

                drafts.appendMessages(new Message[] {msg});

I've tried some things I found on the Internets, such as adding this line:

                Thread.currentThread().setContextClassLoader( getClass().getClassLoader() );

I was wondering if anybody has run into a similar situation and has a solution.

John

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: no object DCH for MIME type application/pdf
      • From: Petite Abeille <email@hidden>
  • Prev by Date: Re: Quote kills nifty description field in javascript, how to prevent?
  • Next by Date: Re: no object DCH for MIME type application/pdf
  • Previous by thread: Re: EOF validation messages questions
  • Next by thread: Re: no object DCH for MIME type application/pdf
  • Index(es):
    • Date
    • Thread