classpathx-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Classpathx-discuss] Bug in JAF 1.1 (ObjectDataContentHandler)


From: Chris Burdess
Subject: Re: [Classpathx-discuss] Bug in JAF 1.1 (ObjectDataContentHandler)
Date: Fri, 12 May 2006 09:09:59 +0100

Markus Wiederkehr wrote:
I tried to send an e-mail using GNU JavaMail 1.1.1 in combination with
GNU Activation 1.1 with this simple code:

 Session session = Session.getInstance(new Properties());
 MimeMessage mm = new MimeMessage(session);

 mm.setSender(new InternetAddress(sender));
 mm.setRecipient(RecipientType.TO, new InternetAddress(recipient));
 mm.setSubject(subject);
 mm.setText(message);

 Transport transport = session.getTransport("smtp");
 transport.connect(host_, port_, "", "");
 Address[] recipients = { new InternetAddress(recipient) };
 transport.sendMessage(mm, recipients);

This led to the following exception:

javax.mail.SendFailedException: no object DCH for MIME type text/ plain; charset=UTF-8 at gnu.mail.providers.smtp.SMTPTransport.sendMessage (SMTPTransport.java:520)

Tracking down the problem I found this code in
javax.activation.ObjectDataContentHandler:

public void writeTo(Object object, String mimeType, OutputStream out)
   throws IOException
 {
   if (dch != null)
     {
       dch.writeTo(object, mimeType, out);
     }
throw new UnsupportedDataTypeException("no object DCH for MIME type " + mimeType);
 }

This method seems to have a bug because the exception gets thrown even
if dch is not null.

Yes, this is fixed in HEAD. I will be making a new release this weekend assuming everyone's OK with that.
--
犬 Chris Burdess
  "They that can give up essential liberty to obtain a little safety
  deserve neither liberty nor safety." - Benjamin Franklin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]