Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8096763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:32:59+00:00 2026-06-05T21:32:59+00:00

After successfully opening Pop3Folder , and retrieving messages from it, I then sometimes get

  • 0

After successfully opening Pop3Folder, and retrieving messages from it, I then sometimes get to the point, when folder.isOpen returns false. At the same time, when looking at the Pop3Folder‘s fields in debug mode, I see that the field opened set to true.

Could somebody give me a hint, what might go wrong here?

Here is the code:

public void popMail(MessageProcessor messageProcessor) throws MessagingException {
  Folder inboxFolder = null;
  Store store = null;
  try {
    store = mailSession.getStore();
    store.connect(mailSession.getProperty("mail.user"),
        mailSession.getProperty("mail.password"));
    // OK. Connected to POP3 Store.
    inboxFolder = store.getFolder("inbox");
    inboxFolder.open(Folder.READ_WRITE);
    // The folder is successfully opened.
    Message[] msgs = inboxFolder.getMessages();
    // Messages are successfully retrieved.
    if (msgs != null && msgs.length > 0) {
      for (Message msg : msgs) {
        if (messageProcessor != null) {
          // Calling custom listener to process message
          messageProcessor.processMessage(msg);
        }
        msg.setFlag(Flag.DELETED, true);
      }
    }
  } finally {
    // Oops, inboxFolder.isOpen returns false.
    // Meanwhile I see in debug mode that inboxFolder#opened is set to true
    if (inboxFolder != null && inboxFolder.isOpen()) {
      try {
        inboxFolder.close(true);
      } catch (MessagingException e) {
        log.warn("Error while closing folder");
      }
    } if (store != null) {
        try {
          store.close();
        } catch (MessagingException e) {
          log.warn("Error while closing store");
        }
      }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T21:33:00+00:00Added an answer on June 5, 2026 at 9:33 pm

    The server may be timing out the connection if your processMessage method takes too long. Turn on Session debugging and examine the protocol trace for clues.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After successfully acquiring an oauth_token for a user, I am able to get successful
I am developing phonegap app in iphone,after successfully viewing pdf file (from server) on
after successfully building my application the start fails because it relies on config files
I'm using NetDataContractSerializer . After successfully deserializing an object, is there a way to
I need to make a thumbnail of an image after successfully uploaded the image
I am having trouble deploying express app on nodester. After successfully running the default
my problem is after i successfully log in,it is not redirect to page that
I am using Struts application while running welcome page is run successfully after that
After logged in successfully, Yii does not executing any page. Showing an error: Error
I have been trying to post using RestKit after I have successfully used it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.