首页 > 解决方案 > 无法使用 MicroMeter 而不是 Prometheus

问题描述

我将我的 Spring 版本从 1.5 升级到 2.0,并将 Prometheus 版本 0.3.0 升级到 0.6.0。但不幸的是,它不起作用。我被告知我必须使用MicroMeter代替SimpleClient并添加io.micrometer到我的pom.xml@EnablePrometheusEndpointremoved我的MetricConfig班级,但我遇到了以下错误。你知道我为什么会出现这种错误吗?

引起:org.springframework.beans.factory.BeanCreationException:在类路径资源[org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration$WebMvcServletEndpointManagementContextConfiguration.class]中定义名称为“servletEndpointRegistrar”的bean创建错误:bean实例化通过工厂方法失败;嵌套异常是 org.springframework.beans.BeanInstantiationException:无法实例化 [org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar]:工厂方法“servletEndpointRegistrar”抛出异常;嵌套异常是 org.springframework.beans.factory.UnsatisfiedDependencyException:创建名称为“routeControllerEndpoint”的 bean 时出错 在类路径资源[org/apache/camel/spring/boot/actuate/endpoint/CamelRouteControllerEndpointAutoConfiguration.class]中定义:通过方法'routeControllerEndpoint'参数0表示的不满足的依赖关系;嵌套异常是 org.springframework.beans.factory.BeanCreationException:创建类路径资源 [org/apache/camel/spring/boot/CamelAutoConfiguration.class] 中定义的名称为“camelContext”的 bean 时出错:合并 bean 定义的后处理失败; 嵌套异常是 java.lang.IllegalStateException: Failed to introspect Class [org.apache.camel.impl.DefaultCamelContext] from ClassLoader [jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd] routeControllerEndpoint'参数0;嵌套异常是 org.springframework.beans.factory.BeanCreationException:创建类路径资源 [org/apache/camel/spring/boot/CamelAutoConfiguration.class] 中定义的名称为“camelContext”的 bean 时出错:合并 bean 定义的后处理失败; 嵌套异常是 java.lang.IllegalStateException: Failed to introspect Class [org.apache.camel.impl.DefaultCamelContext] from ClassLoader [jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd] routeControllerEndpoint'参数0;嵌套异常是 org.springframework.beans.factory.BeanCreationException:创建类路径资源 [org/apache/camel/spring/boot/CamelAutoConfiguration.class] 中定义的名称为“camelContext”的 bean 时出错:合并 bean 定义的后处理失败; 嵌套异常是 java.lang.IllegalStateException: Failed to introspect Class [org.apache.camel.impl.DefaultCamelContext] from ClassLoader [jdk.internal.loader.ClassLoaders$AppClassLoader@77556fd]

标签: spring-bootmetricsprometheusmicrometer

解决方案


推荐阅读