Raju,

You are probably adding the ProtocolCodecFilter to the filterChain of the
SocketAcceptor and
to the filterChain of the SocketAcceptorConfig.

Does your code look like this:

   acceptor.getFilterChain().
           addLast("protocol", new ProtocolCodecFilter(codecFactory)));

   acceptor.getDefaultConfig().getFilterChain().addLast(
             "protocol", new ProtocolCodecFilter(codecFactory));


When a new connection is accepted, MINA will build a new FilterChain for the
new IoSession.
It will add all filters of SocketAcceptor.getFilterChain() and of
SocketAcceptorConfig.getFilterChain() to the filter chain of the IoSession.

But obviuosly, a filter chain can contain only one ProtocolCodecFilter.

So I suggest you remove one of the two ProtocolCodecFilter's

HTH
Maarten

On 5/29/07, Raju Mohanapu <[EMAIL PROTECTED]> wrote:

Hello,
Our application uses MINA (1.1.0) on both the client and server
interfaces. When I try to insert an instance of ProtocolCodecFilter in
each of the Configs (Acceptor and Connector configs), it throws an
exception with the message - "A filter chain cannot contain more than
one ProtocolCodecFilter.".
The error is thrown from onPreAdd method of ProtocolCodecFilter class.

Do I need to supply the protocol codec filter to one of the configs?
either connector or acceptor config? How does the codec filter setting
in one config affect the other?

Thank you for your time

regards
Raju

Reply via email to