[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Classpathx-discuss] Re: Exception in IMAPBodyPart
From: |
Cedric Hyppolite |
Subject: |
Re: [Classpathx-discuss] Re: Exception in IMAPBodyPart |
Date: |
Tue, 2 May 2006 19:58:42 +0200 |
Hi Chris,
You were right, it happened again:
I got an exception in the code:
if (pkey.equals(section))
{
System.out.println("Code class " + code.get(i
+1).getClass());
content = (byte[]) code.get(i + 1);
}
else
{
throw new MessagingException("Unexpected section
number: " +
pkey);
}
Because the cast occurs on a String whereas it expects a byte[]
The API calls look like this:
Multipart multiPart = (Multipart)message.getContent();
for (int j = 0 ; j < multiPart.getCount() ; j++) {
Part part = multiPart.getBodyPart(j);
MimeBodyPart mimeBodyPart = (MimeBodyPart)part;
}
mimeBodyPart.getContent() // Exception
The log is as follows:
Code class class java.lang.String
2006-05-02 19:10:00,664 [main] ERROR
org.humannetwork.net.mail.connection.MailConnection.retrieveMessages
(MailConnection.java:408) - Error while fetching content of message
Id: http://hn.org/platform/info/info#7c3cc9d0-d9fe-11da-b788-
f9cb0bddeddf
Type: http://hn.org/platform/info/info
ParentId: http://hn.org/platform/info/info#3567819c-d9fd-11da-b788-
f9cb0bddeddf
Info List:
Properties
key: http://hn.org/net/mail/readMessageFlag value: false
key: http://hn.org/net/javaMail/fromAddress value:
address@hidden
key: http://hn.org/net/javaMail/subject value: MIME Message5
1146588060926
key: http://hn.org/net/mail/MessageIdHeader value:
<address@hidden
et>
key: http://hn.org/net/javaMail/sentDate value: Tue May 02 18:42:50
CEST 2006
key: http://hn.org/net/javaMail/toAddress value:
address@hidden
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
(IMAPBodyPart.java:107)
at gnu.mail.providers.imap.IMAPBodyPart.getDataHandler
(IMAPBodyPart.java:247)
at javax.mail.internet.MimeBodyPart.getContent(MimeBodyPart.java:683)
at gnu.mail.providers.imap.IMAPBodyPart.getContent(IMAPBodyPart.java:
261)
I'll send you the TCP dumps directly.
The message generating the error is
address@hidden
t with title 'MIME Message5 1146588060926'
Good luck,
Cedric
Le 28 avr. 06 à 16:52, Chris Burdess a écrit :
Cedric Hyppolite wrote:
I can't reproduce the problem with my IMAP server, so it seems
likely it's down to an odd server-specific response to the FETCH.
If you could send tcpdump transcripts of the IMAP conversation I
should be able to work out what's going on.
Actually I can't reproduce it either after I deleted all the mails
sent with the previous version of JavaMail.
I guess, it was a side effect of the other bug.
I don't think so. But if you do manage to reproduce it at some
point, please try and capture the TCP packets and let us know.
--
犬 Chris Burdess
"They that can give up essential liberty to obtain a little safety
deserve neither liberty nor safety." - Benjamin Franklin
- Re: [Classpathx-discuss] Re: Exception in IMAPBodyPart,
Cedric Hyppolite <=