ArrayIndexOutOfBoundsException in Folder.getMessages

C: STAT

S: +OK 671 3625768

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 671

at javax.mail.Folder.getMessages(Folder.java:145)

at javax.mail.Folder.getMessages(Folder.java:136)

The problem seems to be

- that the pop server (gmail) says it holds 671 messages, although there are in fact less than 671 messages ;

- that the Folder class expects the STAT command to return a correct upper bound to iterate through the mails.

Any help would be appreciated.

[531 byte] By [aclinorquea] at [2007-11-26 15:41:22]
# 1
What version of JavaMail are you using? Those line numbers fromFolder.java don't make any sense.
bshannona at 2007-7-8 22:00:00 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
geronimo-spec-javamail-1.3.1-rc3.jar. This comes from a transitive dependency in a maven build.Maybe this is the cause of the problem. I'll try and let you know if it solves it.Thanks.
aclinorquea at 2007-7-8 22:00:00 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3
OK, if javamail-1.4ea is used instead of geronimo-spec-javamail-1.3.1-rc3, there is no problem.This "version" of javamail was imported in my project as a transitive dependency of torque.Thank you, bshannon.
aclinorquea at 2007-7-8 22:00:00 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...