Получение java.lang.VerifyError при отправке почты с использованием javax.mail

Я пытаюсь отправить письмо с вложением, используя функциональность javax.mail, ниже мой код:

// create the message part
MimeBodyPart messageBodyPart = new MimeBodyPart();
// fill message
messageBodyPart.setText(strmessage);
Multipart multipart = new MimeMultipart();
multipart.addBodyPart(messageBodyPart);
AdcsipLogger.adcsipLog("begin exportFile...........");
ExportFile exportFile = buildQuestionnaireReport(questionnaire);
// Part two is attachment
messageBodyPart = new MimeBodyPart();
DataSource source = new ExportFileDataSource(exportFile);
messageBodyPart.setDataHandler(new DataHandler(source));
messageBodyPart.setFileName(questionnaire.getName() + ".pdf");
multipart.addBodyPart(messageBodyPart);
// Put parts in message
message.setContent(multipart);
// Send the message
Transport.send(message);

Я получаю исключение в строке: messageBodyPart.setDataHandler(new DataHandler(source));

Ниже приведена выдержка из stacktrace:

[10/30/13 14:44:38:089 CET] 00000062 ServletWrappe E com.ibm.ws.webcontainer.servlet.ServletWrapper service SRVE0068E: Uncaught exception created in one of the service methods of the servlet QuestionnaireControl in application A430-CADCSIP-V8.0_Run4. Exception created : java.lang.VerifyError: javax/mail/internet/MimeBodyPart.setDataHandler(Ljavax/activation/DataHandler;)V

Пожалуйста помогите. Спасибо.


person Dattaprasad    schedule 30.10.2013    source источник


Ответы (1)


Вы работаете в WebSphere, верно?

Включен ли в ваше приложение файл jar JavaMail? Если это так, возможно, она конфликтует с версией, включенной в WebSphere.

person Bill Shannon    schedule 30.10.2013