[
http://nagoya.apache.org/jira/browse/JAMES-316?page=comments#action_55975 ]
Hes Siemelink commented on JAMES-316:
-------------------------------------
Quick fix:
Alter the method RemoteDelivery.getNextDelay by adding a range check:
/**
* This method returns, given a retry-count, the next delay time to use.
* @param retry_count the current retry_count.
* @return the next delay time to use, given the retry count
**/
private long getNextDelay (int retry_count) {
+ if (retry_count >= delayTimes.length) {
+ return DEFAULT_DELAY_TIME;
+ }
return delayTimes[retry_count-1];
}
This solution will also work if the array of delayTimes shrinks because of a
reconfiguration, but there is still a message with more error attempts hanging
in the queue.
We need a robust solution, because if this method throws an exception James
virtually hangs!
> java.lang.ArrayIndexOutOfBoundsException from RemoteDelivery
> ------------------------------------------------------------
>
> Key: JAMES-316
> URL: http://nagoya.apache.org/jira/browse/JAMES-316
> Project: James
> Type: Bug
> Components: Remote Delivery
> Versions: 2.2.1
> Environment: Windows XP
> Reporter: Bradley D. Brown
> Attachments: config.xml
>
> When I look in the mailet logs, I see pages and pages of errors like this:
> 12/08/04 14:31:01 INFO James.Mailet: RemoteDelivery: Exception caught in
> RemoteDelivery.run()
> java.lang.ArrayIndexOutOfBoundsException: 10
> at
> org.apache.james.transport.mailets.RemoteDelivery.getNextDelay(RemoteDelivery.java:981)
> at
> org.apache.james.transport.mailets.RemoteDelivery.access$000(RemoteDelivery.java:93)
> at
> org.apache.james.transport.mailets.RemoteDelivery$MultipleDelayFilter.accept(RemoteDelivery.java:155)
> at
> org.apache.james.mailrepository.AvalonSpoolRepository.accept(AvalonSpoolRepository.java:156)
> at
> org.apache.james.transport.mailets.RemoteDelivery.run(RemoteDelivery.java:901)
> at java.lang.Thread.run(Unknown Source)
> 12/08/04 14:31:01 INFO James.Mailet: RemoteDelivery: Exception caught in
> RemoteDelivery.run()
> java.lang.ArrayIndexOutOfBoundsException: 2
> at
> org.apache.james.transport.mailets.RemoteDelivery.getNextDelay(RemoteDelivery.java:981)
> at
> org.apache.james.transport.mailets.RemoteDelivery.access$000(RemoteDelivery.java:93)
> at
> org.apache.james.transport.mailets.RemoteDelivery$MultipleDelayFilter.accept(RemoteDelivery.java:155)
> at
> org.apache.james.mailrepository.AvalonSpoolRepository.accept(AvalonSpoolRepository.java:156)
> at
> org.apache.james.transport.mailets.RemoteDelivery.run(RemoteDelivery.java:901)
> at java.lang.Thread.run(Unknown Source)
> Email does not appear to be delivered, my startup is exceptionally slow, but
> that may be a different issue.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]