dcsimg
Unsupported Data Type Exception.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Tuesday, February 12, 2008 08:29 AM

I am trying to email using java mail functionality. The mail has the PDF as an attachment. I am executing the java from command prompt. I included the jar files in the classpath. Both the jar files (mail.jar and activation.jar) are located in same location. I am able to do this on development (runs on windows), but I got an Exception on production (runs on Linux):     javax.activation.UnsupportedDataTypeException: no object DCH for MIME type application/pdf.     at javax.mail.Transport.send0(Transport.java:219)      at javax.mail.Transport.send(Transport.java:81). My sample code is below:  MimeBodyPart mbp2 = new MimeBodyPart();  mbp2.setContent(baos.toByteArray(),"application/pdf");     More>>

I am trying to email using java mail functionality. The mail has the PDF as an attachment. I am executing the java from command prompt. I included the jar files in the classpath. Both the jar files (mail.jar and activation.jar) are located in same location. I am able to do this on development (runs on windows), but I got an Exception on production (runs on Linux):

    javax.activation.UnsupportedDataTypeException: no object DCH for MIME type application/pdf.
    at javax.mail.Transport.send0(Transport.java:219)
     at javax.mail.Transport.send(Transport.java:81).


My sample code is below:
 MimeBodyPart mbp2 = new MimeBodyPart();
 mbp2.setContent(baos.toByteArray(),"application/pdf");
 mbp2.setFileName("example.pdf");

Here baos is ByteArrayOutputStream object which holds the pdf data.
I got exception at code mbp2.setContent(baos.toByteArray(),"application/pdf");

Please give me any suggestion to solve the problem.


Thanks in advance.

   <<Less

Re: Unsupported Data Type Exception.

Posted By:   Robert_Lybarger  
Posted On:   Tuesday, February 12, 2008 08:58 AM

You could try reading previous entries here on this site about that error, first. sounds like there were a couple common issues that bit people.
About | Sitemap | Contact