Spring Boot 2执行器启动器中的Nullpointer w。 Tomcat指标

时间:2019-05-14 15:36:03

标签: spring-boot spring-boot-actuator spring-micrometer

我最近将系统从Spring Boot 1.5升级到了2.1.3,并添加了spring-ioc。显然,某些内容配置错误,因为spring-boot-starter-actuator中有一个NullPointerException

TomcatMetrics::registerMetricsEventually

空指针出现在这里:

java.lang.NullPointerException: null
    at io.micrometer.core.instrument.binder.tomcat.TomcatMetrics.lambda$registerMetricsEventually$aa4da135$1(TomcatMetrics.java:260)
    at java.management/javax.management.NotificationBroadcasterSupport.sendNotification(NotificationBroadcasterSupport.java:238)
    at java.management/javax.management.MBeanServerDelegate.sendNotification(MBeanServerDelegate.java:211)
    at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.sendNotification(DefaultMBeanServerInterceptor.java:1473)
    at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(DefaultMBeanServerInterceptor.java:1867)
    at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:955)
    at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:890)
    at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:320)
    at java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
    at org.apache.tomcat.util.modeler.Registry.registerComponent(Registry.java:639)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.register(AbstractProtocol.java:1059)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:823)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.base/java.lang.Thread.run(Thread.java:834)

因为return objectName.getDomain().equals(getJmxDomain()) && objectName.getKeyProperty(key).equals(value); 返回null。

这是否表明某些东西显然配置错误?

1 个答案:

答案 0 :(得分:0)

我正在使用以下所示的Spring Boot 2.1.8依赖项运行,甚至将运行时范围添加到了测微表的pom中,但这没有帮助。执行器正在寻找同一个键(“ j2eeType”)的值,而不是优雅地对其进行处理。

variant="temporary"