主页 > 游戏开发  > 

使用Actuator启动失败,Failedtostartbean‘documentationPluginsBoo

使用Actuator启动失败,Failedtostartbean‘documentationPluginsBoo

使用Actuator启动失败,Failed to start bean ‘documentationPluginsBootstrapper‘ springboot 2.7在未导入actuator之前运行正常,导入后报错解决办法

springboot 2.7在未导入actuator之前运行正常,导入后报错 org.springframework.context.ApplicationContextException: Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException 解决办法 修改配置 springboot.mvc.pathmatch.matching-strategy=ant_path_matcher添加代码 @Bean public static BeanPostProcessor springfoxHandlerProviderBeanPostProcessor() { return new BeanPostProcessor() { @Override public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (bean instanceof WebMvcRequestHandlerProvider) { customizeSpringfoxHandlerMappings(getHandlerMappings(bean)); } return bean; } private <T extends RequestMappingInfoHandlerMapping> void customizeSpringfoxHandlerMappings(List<T> mappings) { List<T> copy = mappings.stream() .filter(mapping -> mapping.getPatternParser() == null) .collect(Collectors.toList()); mappings.clear(); mappings.addAll(copy); } @SuppressWarnings("unchecked") private List<RequestMappingInfoHandlerMapping> getHandlerMappings(Object bean) { try { Field field = ReflectionUtils.findField(bean.getClass(), "handlerMappings"); field.setAccessible(true); return (List<RequestMappingInfoHandlerMapping>) field.get(bean); } catch (IllegalArgumentException | IllegalAccessException e) { throw new IllegalStateException(e); } } }; }
标签:

使用Actuator启动失败,Failedtostartbean‘documentationPluginsBoo由讯客互联游戏开发栏目发布,感谢您对讯客互联的认可,以及对我们原创作品以及文章的青睐,非常欢迎各位朋友分享到个人网站或者朋友圈,但转载请说明文章出处“使用Actuator启动失败,Failedtostartbean‘documentationPluginsBoo