Niklas Gawell wrote:
Hi,

I'm having troubles with DefaultIoFilterChainBuilder.buildFilterChain(IoFilterChain) that appears to be called twice with the same filter chain on incoming connection resulting in the following error trace: java.lang.IllegalArgumentException: Other filter is using the same name 'filter0' at org.apache.mina.common.support.AbstractIoFilterChain.checkAddable(AbstractIoFilterChain.java:398) at org.apache.mina.common.support.AbstractIoFilterChain.addLast(AbstractIoFilterChain.java:270) at org.apache.mina.common.DefaultIoFilterChainBuilder.buildFilterChain(DefaultIoFilterChainBuilder.java:242) at org.apache.mina.transport.socket.nio.SocketAcceptor$Worker.processSessions(SocketAcceptor.java:353) at org.apache.mina.transport.socket.nio.SocketAcceptor$Worker.run(SocketAcceptor.java:273) at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:43)
       at java.lang.Thread.run(Thread.java:595)
...

I just tried using the XML you posted but with the EchoProtocolHandler and I don't get this error. Looking at the code referenced by the stack trace (SocketAcceptor.java:353) it appears as if the SocketAcceptor's defaultConfig has been configured with filters as well? If these come from a DefaultIoFilterChainBuilderFactoryBean the filter names may very well be the same (the default names are filter0, filter1, etc).

You could try to set a different filterNamePrefix on your DefaultIoFilterChainBuilderFactoryBean and see if that helps or name your filters explicitly using IoFilterMapping objects.

HTH

--
Niklas Therning
www.spamdrain.net

Reply via email to