mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Crane (JIRA)" <j...@apache.org>
Subject [jira] Created: (DIRMINA-739) IllegalArgumentException thrown from ErrorGeneratingFilter
Date Tue, 01 Sep 2009 09:19:32 GMT
IllegalArgumentException thrown from ErrorGeneratingFilter

                 Key: DIRMINA-739
                 URL: https://issues.apache.org/jira/browse/DIRMINA-739
             Project: MINA
          Issue Type: Bug
          Components: Filter
    Affects Versions: 2.0.0-M6
            Reporter: Stephen Crane

I've configured an ErrorGeneratingFilter in my tests and am now occasionally seeing the following

Caused by: java.lang.IllegalArgumentException: n must be positive
	at java.util.Random.nextInt(Random.java:250)
	at org.apache.mina.filter.errorgenerating.ErrorGeneratingFilter.manipulateIoBuffer(ErrorGeneratingFilter.java:187)
	at org.apache.mina.filter.errorgenerating.ErrorGeneratingFilter.messageReceived(ErrorGeneratingFilter.java:118)
	at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:433)

Obviously buffer.remaining() is returning 0 here.

How about the following fix?

if (buffer.remaining() > 0 && changeByteProbability > rng.nextInt(1000)) {
	// as before

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message