When a class is together filter and listener, for example @Component class Together implements Filter, ServletRequestListener, it is only filter, not a listener. The reason in org.springframework.boot.web.servlet.ServletContextInitializerBeans#seen; if something is registered as filter, it became seen and cannot be registered as listener

That is not natural, because 1. Implementing one interface does not invalidate other. If developer decides that one beans serves for 2 purposes, it must be accepted or rejected as a bug 2. For tracing scenario it is natural, that tracing starts when tracing header is available and lasts until request is destroyed. So closing tracing code in single class is natural choice

It it not a big problem and workaround is easy, but it seems to be an inconsistency bug

Comment From: wilkinsona

Thanks for the report. Things have been this way since 1.1 (if not earlier) so I think we may need to tread a little carefully when changing the behaviour in case doing so has unwanted side effects. I think it may be better to treat this as an enhancement, particularly as there's a workaround, and add support for beans that implement more the one contract from the Servlet API being registered multiple times in 3.3.