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

