ToB企服应用市场:ToB评测及商务社交产业平台

标题: Unsatisfied dependency expressed through method 'traceFilterRegist [打印本页]

作者: 卖不甜枣    时间: 2022-8-9 14:47
标题: Unsatisfied dependency expressed through method 'traceFilterRegist
完整错误
Unsatisfied dependency expressed through method 'traceFilterRegistration' parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'javax.servlet.Filter' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Qualifier(value="webRequestLoggingFilter")}
先说下背景,这个错误时在eurekaserver中排除了spring-boot-start-actuator的依赖产生
修复方式
  1.     @Bean
  2.     Filter webRequestLoggingFilter() {
  3.         return new Filter() {
  4.             @Override
  5.             public void init(FilterConfig filterConfig) throws ServletException {
  6.             }
  7.             @Override
  8.             public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
  9.                 filterChain.doFilter(servletRequest, servletResponse);
  10.             }
  11.             @Override
  12.             public void destroy() {
  13.             }
  14.         };
  15.     }
复制代码
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!




欢迎光临 ToB企服应用市场:ToB评测及商务社交产业平台 (https://dis.qidao123.com/) Powered by Discuz! X3.4