getContentType = Nullpointer, "rebuild" message finally works... *confuse*

Hi,

i just got a question, not really a problem.

So let me try to explain.

We receive mails from a groupwise server. Sometimes (not every mail, but some, could not find out which) i am getting a nullpointer if i ask for the contentType.

If i now read the message, write it back .. the rest will work fine. If i don磘 do so, i also get a nullpointer calling getRawInputStream.

.. but let the source explain :)

try{

contentTypeStr = emailMessage.getContentType();

}catch (Exception e){

emailMessage = (MimeMessage)dumpMessage((Message)emailMessage);

in my testscenario, dumpmessage just does something like:

(emailMessage is NOT changed)

//test

File file2 = File.createTempFile("dummy",".eml");

FileOutputStream fileOutputStream2 =new FileOutputStream(file2);

emailMessage.writeTo(fileOutputStream2);

fileOutputStream2.flush();

fileOutputStream2.close();

source =new FileInputStream(file2);

message =new MimeMessage(session, source);

return message;

//test

And now i can finally read the mail properly... no more nullpointer..

may anybody explain that to me?

thx in advance

[1618 byte] By [djnosea] at [2007-11-27 5:52:06]
# 1
I assume you're using IMAP.This is usually caused by a bug in the server. Please post a protocol traceshowing the problem, or send it to me at javamail@sun.com.And make sure you have installed all the latest patches for GroupWise.
bshannona at 2007-7-12 15:42:19 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...