Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-1636

Children coming from a ManagementResourceRegistration.registerOverrideModel() override incorrectly appear as attributes in read-resource-description

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 8.0.0.Alpha3
    • 8.0.0.Alpha2
    • Management
    • None

    Description

      The problem is in OverrideDescriptionCombiner adding the overridden children to the attributes rather than to the children. For background, this was my initial mail on the subject.
      -------
      I found this when trying to read the role based access control settings for the whole of WIldFly. I have worked around this with a hack on my https://github.com/kabir/wildfly/commits/rbac-play branch, which is called "Temp commit, work around problems in /subsystem=datasources/data-source=* definition of statistics". The underlying problem seems to be that there is a problem with the resource definition for this attribute/child type. Apart from this there are no other problems when running with standalone-full-ha.xml.

      The 'statistics' appears as an attribute when doing a read-resource-description
      [standalone@localhost:9990 /] /subsystem=datasources/data-source=ExampleDS:read-resource-description
      {
      "outcome" => "success",
      "result" => {
      "description" => "A JDBC data-source configuration",
      "attributes" => {
      "share-prepared-statements" =>

      { "type" => BOOLEAN, "description" => "Whether to share prepared statements, i.e. whether asking for same statement twice without closing uses the same underlying prepared statement", "expressions-allowed" => true, "nillable" => true, "default" => false, "access-type" => "read-write", "storage" => "configuration", "restart-required" => "no-services" }

      ,
      – SNIP

      "statistics" =>

      { "description" => "Runtime statistics provided by the resource adapter.", "access-type" => "read-only", "storage" => "configuration" }

      },
      "operations" => undefined,
      "children" => {"connection-properties" => {
      "description" => "The connection-properties element allows you to pass in arbitrary connection properties to the Driver.connect(url, props) method",
      "model-description" => undefined
      }}
      }
      }

      However, it does not appears as a child but not as an attribute:

      [standalone@localhost:9990 /] /subsystem=datasources/data-source=ExampleDS:read-children-names(child-type=statistics)
      {
      "outcome" => "success",
      "result" => [
      "jdbc",
      "pool"
      ]
      }[standalone@localhost:9990 /] /subsystem=datasources/data-source=ExampleDS:read-attribute(name=statistics)
      {
      "outcome" => "failed",
      "failure-description" => "JBAS014640: 'statistics' is a registered child of resource ([
      (\"subsystem\" => \"datasources\"),
      (\"data-source\" => \"ExampleDS\")
      ])",
      "rolled-back" => true
      }

      In read-resource it appears as a child:
      [standalone@localhost:9990 /] /subsystem=datasources/data-source=ExampleDS:read-resource(recursive=true, include-runtime=true)
      {
      "outcome" => "success",
      "result" => {
      ---- SNIP ----
      "statistics" => {
      "jdbc" =>

      { "PreparedStatementCacheAccessCount" => "0", "PreparedStatementCacheAddCount" => "0", "PreparedStatementCacheCurrentSize" => "0", "PreparedStatementCacheDeleteCount" => "0", "PreparedStatementCacheHitCount" => "0", "PreparedStatementCacheMissCount" => "0" }

      ,
      "pool" =>

      { "ActiveCount" => "0", "AvailableCount" => "20", "AverageBlockingTime" => "0", "AverageCreationTime" => "0", "CreatedCount" => "0", "DestroyedCount" => "0", "InUseCount" => "0", "MaxCreationTime" => "0", "MaxUsedCount" => "0", "MaxWaitCount" => "0", "MaxWaitTime" => "0", "TimedOut" => "0", "TotalBlockingTime" => "0", "TotalCreationTime" => "0" }

      }
      }
      }
      [standalone@localhost:9990 /] /subsystem=datasources/data-source=ExampleDS/statistics=jdbc:read-resource(include-runtime=true)
      {
      "outcome" => "success",
      "result" =>

      { "PreparedStatementCacheAccessCount" => "0", "PreparedStatementCacheAddCount" => "0", "PreparedStatementCacheCurrentSize" => "0", "PreparedStatementCacheDeleteCount" => "0", "PreparedStatementCacheHitCount" => "0", "PreparedStatementCacheMissCount" => "0" }

      }

      Attachments

        Activity

          People

            kkhan1@redhat.com Kabir Khan
            kkhan1@redhat.com Kabir Khan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: