Michael Bauroth wrote:
> Hi,
>
> can you tell me, what's wrong with this code?
>
> <bean class="org.apache.mina.integration.spring.IoFilterMapping">
>   <constructor-arg value="abc" />
>   <constructor-arg>
>     <bean class="org.apache.mina.filter.LoggingFilter"/>
>   </constructor-arg>
> </bean>
>
> When I use instead:
>
> <bean class="org.apache.mina.filter.LoggingFilter" />
>
> all works fine. When I check the code of class IoFilterMapping, the
> first approach should work?
>
What happens with the first? Do you get an exception? If that's the case
please post it here. I think the first should work as long as you don't
mix the two approaches. You must either use explicit IoFilterMappings
for all your filters set on a DefaultIoFilterChainBuilderFactoryBean or
use the simpler for all. You can't mix them.

You could try to use:

<bean class="org.apache.mina.integration.spring.IoFilterMapping">
  <property name="name" value="abc" />
  <property name="filter">
    <bean class="org.apache.mina.filter.LoggingFilter"/>
  </property>
</bean>

instead. I've had some problems with Spring and constructor-arg before
where Spring couldn't find a matching constructor or picked the wrong
one. Though I don't think that's the case here.

It might help if I get to see more of your Spring file.

-- 
Niklas Therning
Software Architect
www.spamdrain.net

Reply via email to