This is a bit of a specific problem, but I am using javamail to connect to an IMAP server to pull some messages, and when I run my program locally in the command line it runs just fine, but when it is uploaded to tomcat to run, I get this casting error:
java.lang.ClassCastException: javax.mail.internet.MimeMultipart cannot be cast to javax.mail.internet.MimeMultipart
the line of code is:
MimeMultipart mp;
mp = ((MimeMultipart)message.getContent());
message is defined as:
Message message = null;
message = folder.getMessageByUID(14299);
Im not sure why I can cast it when it is run locally, but it crashes on the server. I am using the same message both times, it is hard coded, so there is no chance I will be pulling a message that is not a MimeMultipart. Any ideas? If you need me to post anything else, I will, just ask. Thanks!