Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-25933

(7.4.z) WFLY-14697 - Microprofile Metrics throws NullPointerException when prefix attribute is not set or is blank

XMLWordPrintable

      According to the configuration model, the microprofile-metrics-smallrye subsystem should allow for a null value for `prefix`, but on XP 4.0.1 it will throw NullPointerException on startup/reload if that value is null.

      Fails:

      <subsystem xmlns="urn:wildfly:microprofile-metrics-smallrye:2.0" security-enabled="false" exposed-subsystems="*"/> 

      Succeeds:

      <subsystem xmlns="urn:wildfly:microprofile-metrics-smallrye:2.0" security-enabled="false" exposed-subsystems="*" prefix="${wildfly.metrics.prefix:jboss}"/> 

      And the error which is shown in the logs:

      2023-10-19 06:54:16,280 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("subsystem" => "microprofile-metrics-smallrye")]): java.lang.NullPointerException
              at java.base/java.util.Objects.requireNonNull(Objects.java:221)
              at org.wildfly.extension.metrics@7.4.12.GA-redhat-00003//org.wildfly.extension.metrics.WildFlyMetricMetadata.<init>(WildFlyMetricMetadata.java:55)
              at org.wildfly.extension.metrics@7.4.12.GA-redhat-00003//org.wildfly.extension.metrics.MetricCollector.collectResourceMetrics0(MetricCollector.java:125)
              at org.wildfly.extension.metrics@7.4.12.GA-redhat-00003//org.wildfly.extension.metrics.MetricCollector.collectResourceMetrics0(MetricCollector.java:135)
              at org.wildfly.extension.metrics@7.4.12.GA-redhat-00003//org.wildfly.extension.metrics.MetricCollector.collectResourceMetrics0(MetricCollector.java:135)
              at org.wildfly.extension.metrics@7.4.12.GA-redhat-00003//org.wildfly.extension.metrics.MetricCollector.collectResourceMetrics0(MetricCollector.java:135)
              at org.wildfly.extension.metrics@7.4.12.GA-redhat-00003//org.wildfly.extension.metrics.MetricCollector.collectResourceMetrics(MetricCollector.java:68)
              at org.wildfly.extension.microprofile.metrics-smallrye@4.0.0.GA-redhat-00003//org.wildfly.extension.microprofile.metrics.MicroProfileMetricsSubsystemAdd$2.execute(MicroProfileMetricsSubsystemAdd.java:103)
              at org.jboss.as.controller@15.0.29.Final-redhat-00001//org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:1063)
              at org.jboss.as.controller@15.0.29.Final-redhat-00001//org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:784)
              at org.jboss.as.controller@15.0.29.Final-redhat-00001//org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:470)
              at org.jboss.as.controller@15.0.29.Final-redhat-00001//org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1430)
              at org.jboss.as.controller@15.0.29.Final-redhat-00001//org.jboss.as.controller.ModelControllerImpl.boot(ModelControllerImpl.java:559)
              at org.jboss.as.controller@15.0.29.Final-redhat-00001//org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:546)
              at org.jboss.as.controller@15.0.29.Final-redhat-00001//org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:508)
              at org.jboss.as.server@15.0.29.Final-redhat-00001//org.jboss.as.server.ServerService.boot(ServerService.java:464)
              at org.jboss.as.server@15.0.29.Final-redhat-00001//org.jboss.as.server.ServerService.boot(ServerService.java:417)
              at org.jboss.as.controller@15.0.29.Final-redhat-00001//org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:447)
              at java.base/java.lang.Thread.run(Thread.java:829)
      // code placeholder
      

              chaowan@redhat.com Chao Wang
              rhn-gps-josphill Joseph Phillips
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: