我正在从imap服务器检索邮件,当我执行message.getContent();
时邮件为javax.mail.Message
我得到以下例外:
java.io.IOException: Cannot convert DataSource with content type "TEXT/XML; charset=utf-8; name=FILENAME.XML" to object in XmlDataContentHandler
at com.sun.xml.ws.encoding.XmlDataContentHandler.getContent(XmlDataContentHandler.java:99)
at javax.activation.DataSourceDataContentHandler.getContent(DataHandler.java:790)
at javax.activation.DataHandler.getContent(DataHandler.java:537)
at javax.mail.internet.MimeMessage.getContent(MimeMessage.java:1419)