ArrayIndexOutOfBoundsException on reading mailbox message

I have a java process which reads a IMAP mail box folder with READ WRITE mode. While trying to save one of the message in the INBOX, into the data base, I came across the following error:
java.lang.ArrayIndexOutOfBoundsException: message number (21) out of bounds (20)
      at com.sun.mail.imap.MessageCache.getMessage(MessageCache.java:132)
      at com.sun.mail.imap.MessageCache.getMessageBySeqnum(MessageCache.java:162)
      at com.sun.mail.imap.IMAPFolder.getMessageBySeqNumber(IMAPFolder.java:2809)
It happened once. So, on trying to read the same message again, I didn't face the issue. It happened only once.
Kindly, give some suggestions or thought, to understand what would have happened behind the scene.

Googling with the following phrase seems to suggest likely cause (certainly same as I guessed originally.)
java IMAP ArrayIndexOutOfBoundsException

Similar Messages

  • If I move a mailbox from my imap account to "on my mac" can I safely delete the folder from the mail server and still be able to read the messages?

    If I move a mailbox from my imap account to "on my mac" can I safely delete the folder from the mail server and still be able to read the messages?

    You certainly can.
    Be aware that the emails you move to local storage ("on my Mac") will be the only copies that remain.

  • Message bar reads: 43 messages - 23 deleted

    My Message bar (above Subject, From etc.) reads: 43 messages - 23 deleted. How can I get it to just read the number of messages, which is of course 20?

    What are your Preferences > Accounts > Mailbox Behaviors > Trash settings? It looks like you have turned OFF Move deleted messages to the Trash, which means deleted messages are left in the mailbox, and that’s the information Mail is displaying, i.e. you do have 43 messages in that mailbox, and you could see them all by doing View > Show Deleted Messages.
    BTW, if you’re running Mac OS X 10.3 (Panther), as your profile indicates, it would have been more appropriate to discuss this in the Mail & Address Book - Mac OS X 10.3 & earlier forum. If the discussion applies to both Mail 1.x and Mail 2.x, it doesn’t really matter, but it’s difficult to know that in advance. Mailbox Behaviors, for example, is called differently (Special Mailboxes) in Mail 1.x.

  • Mail not can read some messages.

    I use Mail (3.6) and after do the 10.5.8 upgrade I can not read some messages (the message appears in white), but I can read the same message with Entourage for example...
    I have the same problem with Safari... some sites appears now in white and I cannot read them...
    Before, with the 10.5.7, always work perfect.
    You can help me?
    Thanks!

    Hiya Trebla07,
    have you had a look at mail/preferences/fonts & colours? When you click on the e.g. "mailbox font / Select...", you find tabs for "document colour"; tried changing that?
    Anything in there that could change the colour of the font?
    As I suspect it is merely a white font on a white screen background, which would, of course, be illegible.
    In Safari, it would be preferences/appearance.
    Although it's peculiar that this occured after the 10.5.8 update, but apart from a corrupt font/preference, I would not know what would cause this.
    NB: I just went to elperiodico and it looks fine in Safari. What is the "default encoding" (also found in preferences/appearance)?
    Message was edited by: Alexandre

  • Can't read new messages in IN folder

    This is similar to Spirelli's problem "Can't read messages in sent folder" of 28 August except the problem is with newly downloaded mail. Any unread mail (even from days or weeks ago read as: +The message from "Fae Gleisner" <[email protected]> concerning “SUBJECT OF EMAIL” has not been downloaded from the server. You need to take this account online in order to download it.+
    This happens after MAIL (1.3.11) has been open for a while (sometimes for only a few minutes; somestimes for an hour. The only way to read the messages is to QUIT MAIL and then re-open it.
    This happened a few months ago and then mysteriously corrected.
    In Mail > Preferences > Accounts, Special Mailboxes tab at Sent, and see what it reports for, Erase copies of sent messages when: is set for NEVER.
    Thanks, Robert

    And again, if this is a POP account, you probably have the problem described in the following article:
    Overstuffed mailbox is unexpectedly empty
    If you’re just starting to experience the problem, doing what the article suggests might work. If you’ve let the problem to become worse over time, however, it may be too late to solve it as described in the article. Post back with your observations.

  • Read POP messages marked as unread

    Shouldn't Mail know when a message retrieved from a POP server has been flagged by the server as read? I access the POP account from several different locations and don't want to read through messages I've already read at work. Eudora seemed to manage this fine....

    I'm not sure how Eudora does this since the inbox mailbox for a POP account is not synchronized with the server.
    New messages available and that remain at the incoming mail server for a POP account not yet downloaded by the email client being used to access the account will be downloaded. If another email client is used to access the same POP account, and messages downloaded by the other email client are read with that email client, the read/unread status for the messages with the email client used is not communicated or synchronized with the server.
    This is a function and feature of an IMAP account, not a POP account.

  • When my husband set up his new iPhone I read a message wrong when it popped up on my phone and now our messaging is synced. Is it because we have the same apple ID? Do we need to change that?

    When my husband set up his new iPhone I read a message wrong when it popped up on my phone and now our messaging is synced. Is it because we have the same apple ID? Do we need to change that?

    Yes, its best to have each individual apple ids. You can also go to settings, messages, send and recieve, start new conversation from, make sure there is a check mark beside each of your own individual email, not the same one on each phone.

  • Two computers share the same wi-fi Modem . When computer A reads a message it is marked as read on both PC's, not allowing computer B to see what must be read.

    Two computers share the same WI-fi Modem . When computer A reads a message it is marked as read on both PC's, not allowing computer B to see what must still be read. Email is Thunderbird.
    Please help, Thank you for this online support option

    Imap wasn't designed for this kind of multi user situation. It assumes that you the account owner will be using it to manage one account via multiple devices. So once you have read a message it has been read, regardless of which device you were using at the time.
    You appear to be describing a situation where you want more than one user to read each message, without anyone knowing if anyone else has read it or even dealt with it. Frankly, I can't imagine a set of circumstances where this workflow would make sense or be useful.
    You can do various things such as manually setting messages as unread, or moving them from one folder to another to indicate that they have been processed, but much of this relies on users being thorough and conscientious.
    You may need to be running your own server to do this sort of email message managing, if you really need to fork a message so it gets to multiple recipients. Managing which users see a particular message is a job for a server, not the end-user's email client.

  • "Error while reading Exceptions" - Message No. /SCMB/ORDER 351

    Hello,
    An error message that we are getting as "Error while reading Exceptions" - Message No. /SCMB/ORDER 351 while entering a Work Order Number in the 'Work Order details' screen in the SNC Web UI. So, please let us know how to tackle this error in SNC.
    Regards,
    PCN

    Hello Pavan,
    This message can occure at multiple places. Most of these are status reading and checking in the /SCA/CL_SVORDER class. The following methods can throw this message:
    CHECK_ITEM_EXCEPTION_STATUS
    You can set a BP at line 20 and debug the STATUS_CHECK function.
    GET_ITEM_EXCEPTION_STATUS
    You can set a BP at line 29 and debug the STATUS_READ function.
    READ_ITEM_EXCEPTION_STATUS 
    You can set a BP at line 31 and debug the /scmb/cl_odm=>get3_by_id method.
    I hope this will help you.
    Regards,
    Richard

  • Error saving data structure CE11000 (please read log) message number KX 655

    while activating the data structure in the operating concern of CO PA sap gives the following errors.
    1.Error saving data structure CE11000 (please read log)
    Message no. KX655
    2.Error saving table CE01000
    Message no. KX593
    3.in Log Reference field CE31000-REC_WAERS for CE31000-VVQ10001 has incorrect type.
    Pls suggest

    Hey,
    Below tables are related to application logs
    BAL_AMODAL  :                   Application Log: INDX table for amodal communication
    BALC        :                   Application Log: Log or message context            
    BALDAT      :                   Application Log: Log data                          
    BALHANDLE   :                   Application Log: Lock object dummy table           
    BALHDR      :                   Application log: log header                        
    BALHDRP     :                   Application log: log parameter                     
    BAL_INDX    :                   Application Log: INDX tables                       
    BALM        :                   Application log: log message                       
    BALMP       :                   Application log: message parameter                 
    BALOBJ      :                   Application log: objects                           
    BALOBJT     :                   Application log: object texts                      
    BALSUB      :                   Application log: sub-objects                       
    BALSUBT     :                   Application log: Sub-object texts                  
    -Kiran
    *Please mark useful answers

  • Cannot open PDF files with Reader XI message appears Adobe Reader has stopped working

    Cannot open PDF files with Reader XI message appears Adobe Reader has stopped working. A problem has caused the program to stop working

    Which Operating system you are using?
    Can you open Adobe Reader by itself?  If so, try disabling Protected Mode [Edit | Preferences | Security (Enhanced)] and then try to open the file.

  • There used to be a preview window in mail where you could read the message in the mail box but now its gone. It just shows me who its from and the date. I now have to click on the message twice to get it to display. How do I get the preview box back?

    There used to be a preview window in mail where you could read the message in the mail box but now its gone. It just shows me who its from and the date. I now have to click on the message twice to get it to display. How do I get the preview box back?

    There is a bug in Mail triggered by receiving a password-protected PDF as an attachment. According to reports, the bug is fixed in OS X 10.8.5.

  • How to Read a Message with Content Type multipart/alternative

    Hi ,
    I need to write a POP3 Client to read email message ..but some times the messages comes with content type multipart/alternative
    how to parse it and read only one of the content :
    for example :
    This is a multi-part message in MIME format.
    ------=_NextPart_000_12C25_01C6B64F.09226B00
    Content-Type: text/plain;
    charset="iso-8859-1"
    Content-Transfer-Encoding: 7bit
    Assignment to workgroup Name 1 : L2 SD Service Delivery Apps Spt
    Open CI Search Code : HPSD
    Description : tesat
    General Information :
    Is the workgroup owner Aware of the addition to Workgroup : Yes
    Workgroup to be added :
    L2 SD Service Delivery Apps Spt
    ------=_NextPart_000_12C25_01C6B64F.09226B00
    Content-Type: text/html;
    charset="iso-8859-1"
    Content-Transfer-Encoding: quoted-printable
    <br><P>Assignment to workgroup Name 1 : L2 SD Service Delivery Apps =
    Spt</P>
    <P>Open CI Search Code : HPSD</P>
    <P>Description : tesat</P>
    <P>General Information :</P>
    <P>Is the workgroup owner Aware of the addition to Workgroup : Yes</P>
    <P>Workgroup to be added :</P>
    <P>L2 SD Service Delivery Apps Spt</P>
    <P> </P>
    <P> </P>
    <P> </P>
    <P> </P>
    <P> </P>
    ------=_NextPart_000_12C25_01C6B64F.09226B00--
    The Same message is in text as well as HTML so not sure how to read it .
    currently my program is as follows
    for (int i = 0; i < found.length; i++) {
    Message m = found;
    // Get some headers
    Date date = m.getSentDate();
    Address [] from = m.getFrom();
    String subj = m.getSubject();
    String mimeType = m.getContentType();
    System.out.println(date + "\t" + from[0] + "\t" +
    subj + "\t" + mimeType);
    Object o = m.getContent();
    if (o instanceof String) {
    System.out.println("**This is a String Message**");
    System.out.println((String)o);
    } else if (o instanceof Multipart) {
    System.out.print("**This is a Multipart Message. ");
    Multipart mp = (Multipart)o;
    int count3 = mp.getCount();
    System.out.println("It has " + count3 +
    " BodyParts in it**");
    for (int j = 0; j < count3; j++) {
    // Part are numbered starting at 0
    BodyPart b = mp.getBodyPart(j);
    String mimeType2 = b.getContentType();
    System.out.println( "BodyPart " + (j + 1) +
    " is of MimeType " + mimeType);
    Object o2 = b.getContent();
    if (o2 instanceof String) {
    System.out.println("**This is a String BodyPart**");
    System.out.println((String)o2);
    } else if (o2 instanceof Multipart) {
    System.out.print(
    "**This BodyPart is a nested Multipart. ");
    Multipart mp2 = (Multipart)o2;
    int count2 = mp2.getCount();
    System.out.println("It has " + count2 +
    "further BodyParts in it**");
    } else if (o2 instanceof InputStream) {
    System.out.println(
    "**This is an InputStream BodyPart**");
    } //End of for
    } else if (o instanceof InputStream) {
    System.out.println("***********************************This is an InputStream message**");
    InputStream is = (InputStream)o;
    /* if(m.getContentType().equalsIgnoreCase("multipart/alternative")) {
    MimeMultipart mp = new MimeMultipart();
    // Assumes character content (not binary images)
    } else {*/
    BufferedReader reader
    =new BufferedReader(new InputStreamReader(is));
    String thisLine=reader.readLine();
    while (thisLine!=null) {
    System.out.println(thisLine);
    thisLine=reader.readLine();
    So when the Content TYpe is multipart/alternative it goes into InputStream message .
    any help and ideas to handel such situations ?
    Thanks
    San
    Message was edited by:
    sanrosh_95

    Try reposting that with tags (replace the {'s with ['s).
    Long story short, I think the FAQ and examples would go a long way towards explaining this, but you basically can check the content type, or check if the content contains parts, and parse each part separately.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How do I read/receive messages that were sent to me while my phone was on airplane mode?

    I recently went away camping and turned my phone on airplane mode so I wouldn't receive any charges. But when I take my phone off airplane mode it shows I have no new messages showing. I was wondering how I can receive and read those messages once I take it off of airplane mode.

    First thing to try is to reset your device. Press and hold the Home and Sleep buttons simultaneously until the Apple logo appears. Let go of the buttons and let the device restart. See if that fixes your problem.

  • How to read the message body in a mail

    how can we read the message body of a mail. i am using pop3 server for reading the mails. my program is
    public class GetMessageExample {
    public static void main (String args[]) throws Exception {
    String host = args[0];
    String username = args[1];
    String password = args[2];
    Properties props = new Properties();
    Session session = Session.getInstance(props, null);
    Store store = session.getStore("pop3");
    store.connect(host, username, password);
    Folder folder = store.getFolder("INBOX");
    folder.open(Folder.READ_ONLY);
    BufferedReader reader = new BufferedReader (
    new InputStreamReader(System.in));
    Message message[] = folder.getMessages();
    for (int i=0, n=message.length; i<n; i++) {
    System.out.println(i + ": " + message.getFrom()[0]
    + "\t" + message[i].getSubject());
    System.out.println(
    "Do you want to read message? [YES to read/QUIT to end]");
    String line = reader.readLine();
    if ("YES".equals(line)) {
    message[i].writeTo(System.out);
    } else if ("QUIT".equals(line)) {
    break;
    folder.close(false);
    store.close();
    i am getting the following exception
    Exception in thread "main" java.lang.NoSuchFieldError: contentStream
    at com.sun.mail.pop3.POP3Message.getContentStream(POP3Message.java:115)
    at javax.mail.internet.MimePartDataSource.getInputStream(MimePartDataSou
    rce.java:61)
    at com.sun.mail.handlers.text_plain.getContent(text_plain.java:65)
    at javax.activation.DataSourceDataContentHandler.getContent(DataHandler.
    java:755)
    at javax.activation.DataHandler.getContent(DataHandler.java:511)
    at javax.mail.internet.MimeMessage.getContent(MimeMessage.java:1072)

    The Part interface that the Message class implements describes 3 ways for getting the content of a message. To use an Input Stream, you can call the getInputStream() method on the message itself, rather than System.in.
    Hope this helps!

Maybe you are looking for

  • Help with Aperture 3 printing to Epson R1800 please

    No I haven't got the wrong forum, I think I will get the best answer here. I am a fully paid up member of the Lightroom 2 club and like to use both as I am sure others here do. I cannot get a good print from Aperture 3, there is always a slight magen

  • Why is my final swf so slow/stuttering?

    Need help cause Im going out of my mind. I have created a webpage with some frame by frame animations and I've tried it in Flash at different simulated download speeds and it works perfect. But when uploaded to internet it runs like slowmotion in bot

  • Font installation leads to change in Page Size

    Hi Everyone, I'm using Crystal Reports to generate PDF reports and encountered a couple of issues. Firstly, I was unable to get the Crystal SDK to format the report in the manner I expected. The text that was configured to be displayed in bold font w

  • Freeze half of the frame only?

    Hi, I am editing an interview with two people where they are both seated and still. Right at the end of the best take I got, the person on the left moves their eyes and looks at the cameraman which ruins this take. This is whilst the person on the ri

  • Erros Installing FCP 5

    Maybe someone can help me, I decided to be a good guy and purchase FCP Hd legally. I am doing a clean install did the disk warrior thing, repaired permissions. then started to install fcp I get halfway through and get "There were errors installing so