I found the issue.
By default, in WebInitializer, the setServletConfig() method should return null so that the application context is used.
Otherwise, if you explicitly point to a class annotated with @EnableWebMvc, you must rescan the components using @ComponentScan; if you don’t, the components will only be defined in the application context and won’t be accessible to the servlet context.
This can make the logs quite confusing and tricky to debug