为什么'bodyPart.isMimeType(" text / plain")'给出错误'无法加载bodystructure'? [英] Why does 'bodyPart.isMimeType("text/plain")' give the error 'Unable to load bodystructure'?

查看:771
本文介绍了为什么'bodyPart.isMimeType(" text / plain")'给出错误'无法加载bodystructure'?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用Java创建一个应用程序,通过Java从我的GoDaddy webmail中读取邮件。我已经使用了javax.mail。
当我调试程序时,它在行中出错: bodyPart.isMimeType(text / plain)



出乎意料的是,它以正确的方式处理第一封邮件,但却给出了第二封邮件的错误。



这是完整的堆栈跟踪:

  javax.mail.MessagingException:无法在com.sun.mail.imap.IMAPMessage.loadBODYSTRUCTURE(IMAPMessage)加载BODYSTRUCTURE 
.java:1306)
at com.sun.mail.imap.IMAPMessage.getContentType(IMAPMessage.java:465)
at javax.mail.internet.MimeBodyPart.isMimeType(MimeBodyPart.java:1050)
at javax.mail.internet.MimeMessage.isMimeType(MimeMessage.java:986)
atanaLambdaIntegrationDebugMode.getNameMailIdFromMessage(asanaLambdaIntegrationDebugMode.java:1318)
asanaLambdaIntegrationDebugMode.main(asanaLambdaIntegrationDebugMode.java:978)

对此有任何建议吗?

解决方案

尝试使用此处描述的解决方法:
https:// javaee .github.io / javamail / FAQ#imapserverbug



希望这有帮助。


I am creating an application in Java to read mails from my GoDaddy webmail through Java. I have used javax.mail for this. When I debug the program, it gives an error at the line: bodyPart.isMimeType("text/plain")

Unexpectedly, it processes the first mail in the right way but gives the error for the second mail.

Here is the complete stack trace:

javax.mail.MessagingException: Unable to load BODYSTRUCTURE
    at com.sun.mail.imap.IMAPMessage.loadBODYSTRUCTURE(IMAPMessage.java:1306)
    at com.sun.mail.imap.IMAPMessage.getContentType(IMAPMessage.java:465)
    at javax.mail.internet.MimeBodyPart.isMimeType(MimeBodyPart.java:1050)
    at javax.mail.internet.MimeMessage.isMimeType(MimeMessage.java:986)
    at asanaLambdaIntegrationDebugMode.getNameMailIdFromMessage(asanaLambdaIntegrationDebugMode.java:1318)
    at asanaLambdaIntegrationDebugMode.main(asanaLambdaIntegrationDebugMode.java:978)

Any suggestions on this please?

解决方案

Give a try to the workaround described here: https://javaee.github.io/javamail/FAQ#imapserverbug

Hope this helps.

这篇关于为什么'bodyPart.isMimeType(" text / plain")'给出错误'无法加载bodystructure'?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆