javax.mail.Message mimeMessage = (javax.mail.Message)array[1];
投掷
com.liferay.portal.kernel.messaging.MessageListenerException: java.lang.ClassCastException: javax.mail.internet.MimeMessage cannot be cast to javax.mail.Message.
Caused by: java.lang.ClassCastException: javax.mail.internet.MimeMessage cannot be cast to javax.mail.Message
public void Receive(Message message) throws Exception {
Object[] array = (Object[])message.getPayload();
FileVersion sourceFileVersion = (FileVersion)array[0];
javax.mail.Message mimeMessage = (javax.mail.Message)array[1];
那是因为您正在将MimeMessage转换为Message,尝试更改如下,
MimeMessage mimeMessage = (javax.mail.internet.MimeMessage) array[1];