Re: Exception in IMAPBodyPart

Cedric Hyppolite <[email protected]> Wed, 26 Apr 2006 21:18:08 +0200
Newsgroups gmane.comp.java.classpath.extensions.discuss
Message-ID <[email protected]>
The exact stack trace is:

java.lang.ClassCastException
	at =
gnu.mail.providers.imap.IMAPBodyPart.update(IMAPBodyPart.java:189)
	at =
gnu.mail.providers.imap.IMAPBodyPart.fetch(IMAPBodyPart.java:129)
	at gnu.mail.providers.imap.IMAPBodyPart.fetchContent=20
(IMAPBodyPart.java:107)
	at gnu.mail.providers.imap.IMAPBodyPart.getDataHandler=20
(IMAPBodyPart.java:247)
	at =
javax.mail.internet.MimeBodyPart.getContent(MimeBodyPart.java:683)
	at =
gnu.mail.providers.imap.IMAPBodyPart.getContent(IMAPBodyPart.java:=20
261)

C=E9dric

Le 26 avr. 06 =E0 21:13, Cedric Hyppolite a =E9crit :

> Hi Chris, all,
>
> The first problem is now solved. (Thread 'bug in MIME header parsing')
>
> However I still can't read the message. The following code throws =20
> an exception on the same message I sent you already.
>
>
>
> 		Message message[] =3D folder.getMessages();
> 		FetchProfile fetchProfile =3D new FetchProfile();
> 	=09
> 		fetchProfile.add(UIDFolder.FetchProfileItem.ENVELOPE);
> 		=
fetchProfile.add(UIDFolder.FetchProfileItem.CONTENT_INFO);
> 		fetchProfile.add(UIDFolder.FetchProfileItem.FLAGS);
> 	=09
> 		try {
> 			folder.fetch(message, fetchProfile);
> 		} catch (MessagingException e) {
> 		}
>
> 		message.getContent() // Exception !
>
>
> On the bright side, this exception was already present before I =20
> switch to CVS_HEAD.  So it should not be a side-effect
> of the previous fix. I thought it was linked to the first problem, =20
> but it seems to be a different issue.
>
> Any idea/fix would be appreciated.
>
> Regards,
>
> Cedric HYPPOLITE
>
>
>