1. glassfish
  2. GLASSFISH-19274

Flashlight ProbeProviderRegistry.registerProbeProvider error can be more specific when it rejects a provider if due to the class having been registered already


    • Type: Bug Bug
    • Status: Open
    • Priority: Trivial Trivial
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: monitoring
    • Labels:
    • Environment:



      I was doing some testing using XML providers and hit a failure processing some of the XML files:
      java.lang.IllegalStateException: Provider already mapped CamelNameTestModuleProvider:CamelNameTestModule:CamelNameTestProvider
      at org.glassfish.flashlight.impl.core.ProbeProviderRegistry.registerProbeProvider(
      at org.glassfish.flashlight.impl.provider.FlashlightProbeProviderFactory.registerProvider(
      at org.glassfish.flashlight.impl.provider.FlashlightProbeProviderFactory.processXMLProbeProviders(

      The error pointed me at the right XML file with a problem, but it turns out the problem was the classname in the XML file was the same as a provider already registered (and the name of the provider was OK).

      if (providerMap.putIfAbsent(qname, provider) != null)

      { throw new IllegalStateException("Provider already mapped " + qname); }

      if (classProviderMap.putIfAbsent(clz, provider) != null)

      { throw new IllegalStateException("Provider already mapped " + qname); <== This is line 104 where the exception was thrown }

      The IllegalStateException in ProbeProviderRegistry.registerProbeProvider may want to clarify that problem is that class already was mapped there for a different provider name. Ie: in this case, it was a new probe provider name, but the same class was specified. A minor thing, but I'm thinking it could really help someone that did a cut/paste of the XML there like I did to catch what was wrong about it faster.


        There are no comments yet on this issue.


          • Assignee:
            Byron Nevins
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: