JavaMail开发报错日志 FolderClosedException: Lost folder connection to server

JavaMail开发报错日志 FolderClosedException: Lost folder connection to server_第1张图片

 

使用环境:

       Android/java 开发邮件javaMail

报错内容:


2023-05-06 09:31:01.719 7402-8158/com.cinfotech.my D/ImapEmailMessageAnalysis: ===================>[ImapEmailMessageAnalysis.parseNewMessage() (ImapEmailMessageAnalysis.java:175)]获取邮件报错-->Lost folder connection to server
2023-05-06 09:31:01.719 7402-8158/com.cinfotech.my W/System.err: javax.mail.FolderClosedException: Lost folder connection to server
2023-05-06 09:31:01.719 7402-8158/com.cinfotech.my W/System.err:     at com.sun.mail.imap.IMAPFolder.checkOpened(IMAPFolder.java:480)
2023-05-06 09:31:01.719 7402-8158/com.cinfotech.my W/System.err:     at com.sun.mail.imap.IMAPFolder.getUID(IMAPFolder.java:2737)
2023-05-06 09:31:01.719 7402-8158/com.cinfotech.my W/System.err:     at com.cinfotech.my.email.ImapEmailMessageAnalysis.parseNewMessage(ImapEmailMessageAnalysis.java:160)
2023-05-06 09:31:01.719 7402-8158/com.cinfotech.my W/System.err:     at com.cinfotech.my.email.QueryEmail.queryNewEmail(QueryEmail.java:184)
2023-05-06 09:31:01.719 7402-8158/com.cinfotech.my W/System.err:     at com.cinfotech.my.net.email.EmailRequest.queryNewEmail(EmailRequest.java:197)
2023-05-06 09:31:01.719 7402-8158/com.cinfotech.my W/System.err:     at com.cinfotech.my.util.GetEmailService.queryEmail(GetEmailService.java:250)
2023-05-06 09:31:01.719 7402-8158/com.cinfotech.my W/System.err:     at com.cinfotech.my.util.GetEmailService.toQueryEmail(GetEmailService.java:204)
2023-05-06 09:31:01.719 7402-8158/com.cinfotech.my W/System.err:     at com.cinfotech.my.util.GetEmailService$4.run(GetEmailService.java:189)
2023-05-06 09:31:01.719 7402-8158/com.cinfotech.my W/System.err:     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:458)
2023-05-06 09:31:01.719 7402-8158/com.cinfotech.my W/System.err:     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2023-05-06 09:31:01.719 7402-8158/com.cinfotech.my W/System.err:     at java.util.concurrent.ThreadPoolExecutor.processTask(ThreadPoolExecutor.java:1187)
2023-05-06 09:31:01.719 7402-8158/com.cinfotech.my W/System.err:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
2023-05-06 09:31:01.719 7402-8158/com.cinfotech.my W/System.err:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
2023-05-06 09:31:01.719 7402-8158/com.cinfotech.my W/System.err:     at java.lang.Thread.run(Thread.java:784)

解决方法:

根据报错内容提示:
获取邮件报错-->Lost folder connection to server 与服务器的文件夹连接丢失。
结合项目代码、功能来看是指javaMail在建立邮箱服务器连接以后,获取指定类型文件夹下的邮件时文件夹的名称不对,比如常规邮件“已发送”邮件对应的文件夹是“sendInfo”,而我使用的是“send”。

部分邮箱厂商的发件箱、收件箱文件夹名称相同,但QQ企业等部分邮箱厂商不太一样,需要做区分,这里下一篇再解决。

更多问题欢迎留言或者进群讨论:QQ88627109
祝各位工友永无BUG、大吉大利!

你可能感兴趣的:(java,jvm,eclipse)