Hi Guys
I'm trying to create a custom exception resolver chain as follows:
Code:
However, I get NPE later in the execution chain because the "resolver" class field above is always null. I also get null if I use @Autowired in the above.Code:@Configuration @EnableWebMvc @ComponentScan(basePackages = "web.client") public class WebApplicationConfiguration extends WebMvcConfigurerAdapter { private static final Logger log = LoggerFactory.getLogger(WebApplicationConfiguration.class); @Inject private MonitoringExceptionResolver resolver; @Override public void configureHandlerExceptionResolvers(List<HandlerExceptionResolver> exceptionResolvers) { log.debug("configuring exception resolvers"); super.configureHandlerExceptionResolvers(exceptionResolvers); exceptionResolvers.add(new DefaultHandlerExceptionResolver()); exceptionResolvers.add(new AnnotationMethodHandlerExceptionResolver()); exceptionResolvers.add(new ResponseStatusExceptionResolver()); exceptionResolvers.add(resolver); } }
This class should be successfully wired elsewhere using component scanning. Why is it always null in the above? Am I doing something wrong?
TIA...


Reply With Quote
