Re: Bug in JAF 1.1 (ObjectDataContentHandler)

Chris Burdess <[email protected]> Fri, 12 May 2006 09:09:59 +0100
Newsgroups gmane.comp.java.classpath.extensions.discuss
Message-ID <[email protected]>
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--===============1550271886==
Content-Type: multipart/signed; protocol="application/pgp-signature";
	micalg=pgp-sha1; boundary="Apple-Mail-1--537008097"
Content-Transfer-Encoding: 7bit

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--Apple-Mail-1--537008097
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8; delsp=yes; format=flowed

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 =3D Session.getInstance(new Properties());
>>  MimeMessage mm =3D new MimeMessage(session);
>>
>>  mm.setSender(new InternetAddress(sender));
>>  mm.setRecipient(RecipientType.TO, new InternetAddress(recipient));
>>  mm.setSubject(subject);
>>  mm.setText(message);
>>
>>  Transport transport =3D session.getTransport("smtp");
>>  transport.connect(host_, port_, "", "");
>>  Address[] recipients =3D { new InternetAddress(recipient) };
>>  transport.sendMessage(mm, recipients);
>
> This led to the following exception:
>
>> javax.mail.SendFailedException: no object DCH for MIME type text/=20
>> plain; charset=3DUTF-8
>>     at gnu.mail.providers.smtp.SMTPTransport.sendMessage=20
>> (SMTPTransport.java:520)
>
> Tracking down the problem I found this code in
> javax.activation.ObjectDataContentHandler:
>
>>  public void writeTo(Object object, String mimeType, OutputStream =20
>> out)
>>    throws IOException
>>  {
>>    if (dch !=3D null)
>>      {
>>        dch.writeTo(object, mimeType, out);
>>      }
>>    throw new UnsupportedDataTypeException("no object DCH for MIME =20
>> 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 =20
weekend assuming everyone's OK with that.
--=20
=E7=8A=AC Chris Burdess
   "They that can give up essential liberty to obtain a little safety
   deserve neither liberty nor safety." - Benjamin Franklin





--Apple-Mail-1--537008097--



--===============1550271886==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Classpathx-discuss mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpathx-discuss

--===============1550271886==--