I have been building an application that uses JavaMail to send emergency messages out to co-workers. This application also allows them to respond. The application reads all messages received and does work based on the information in said text.
In the previous months we have had no issues until recently (past 1 week or so) when reading MMS messages. Plain Text messages work fine.
Here is the error we are receiving when we grab an MMS message from a user:
//this is all printed logs and no error here //however the information may help you
type="application/smil"
boundary=__CONTENT_64564_PART_BOUNDARY__33243242__;
multipart/MIXED;
This is a Multipart
---------------------------
error reading email: java.lang.ClassCastException:
javax.mail.internet.MimeMultipart incompatible with javax.mail.Multipart
I have even tried switching my code here:
else if (m.isMimeType("multipart/*")) {
System.out.println("This is a Multipart");
System.out.println("---------------------------");
//Multipart mmp = (Multipart) m.getContent(); //Current code for error above
MimeMultipart mmp = (MimeMultipart) m.getContent();
int count = mmp.getCount();
for (int i = 0; i < count; i++){
boolean completedMultipart = false;
completedMultipart = dumpMultiPart(mmp.getBodyPart(i), smsAddress);
if(completedMultipart){
completedTask = true;
}
}
}
However this still returns this error:
error reading email: java.lang.ClassCastException: javax.mail.internet.MimeMultipart
incompatible with javax.mail.MimeMultipart
I have read that Classpaths could be an issue, however I believe I have things set up correctly. Here is an image of the classpath setup:
Class path