Hi Community,
I'm working with idempiere 9.
I am trying to read attachments from mails.
This is the exception:
java.lang.ClassCastException: class com.sun.mail.imap.IMAPInputStream cannot be cast to class javax.mail.Multipart (com.sun.mail.imap.IMAPInputStream and javax.mail.Multipart are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @7e9fb617
Here is the code and the line that triggers the error:
Message[] messages = emailFolder.getMessages();
for (int i = 0; i < messages.length; i++) {
Message message = messages[i];
String contentType = message.getContentType();
if (contentType.contains("multipart")) {
Multipart multiPart = (Multipart) message.getContent();
int numberOfParts = multiPart.getCount();
.....
I've searched the web but can't figure it out.
I appreciate your help
Thanks very much !!!