Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-5949

Adding meta-data to json-logger via YamlConfigurationExtension results in ClassCastException

XMLWordPrintable

      I'm getting a ClassCastException when I try to add "meta-data" to a json-logger within subsystem "logging".

      As this is a new feature and documentation/examples are rare I am not confident that I created the yaml file semantically correct. But no matter how I define the yaml - as soon as "meta-data" is added to the yaml (and no matter what content it provides), the application server fails to boot with this stack trace:

      16:02:18,511 ERROR [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0055: Caught exception during boot: java.lang.ClassCastException: class org.jboss.as.controller.SimpleMapAttributeDefinition cannot be cast to class org.jboss.as.controller.ObjectTypeAttributeDefinition (org.jboss.as.controller.SimpleMapAttributeDefinition and org.jboss.as.controller.ObjectTypeAttributeDefinition are in unnamed module of loader 'org.jboss.as.controller@19.0.0.Beta12' @5ed828d)
      at org.jboss.as.controller@19.0.0.Beta12//org.jboss.as.controller.persistence.yaml.YamlConfigurationExtension.processAttributes(YamlConfigurationExtension.java:350)
      at org.jboss.as.controller@19.0.0.Beta12//org.jboss.as.controller.persistence.yaml.YamlConfigurationExtension.processResource(YamlConfigurationExtension.java:260)
      at org.jboss.as.controller@19.0.0.Beta12//org.jboss.as.controller.persistence.yaml.YamlConfigurationExtension.processResource(YamlConfigurationExtension.java:171)
      at org.jboss.as.controller@19.0.0.Beta12//org.jboss.as.controller.persistence.yaml.YamlConfigurationExtension.processResource(YamlConfigurationExtension.java:171)
      at org.jboss.as.controller@19.0.0.Beta12//org.jboss.as.controller.persistence.yaml.YamlConfigurationExtension.processResource(YamlConfigurationExtension.java:177)
      at org.jboss.as.controller@19.0.0.Beta12//org.jboss.as.controller.persistence.yaml.YamlConfigurationExtension.processOperations(YamlConfigurationExtension.java:149)
      at org.jboss.as.controller@19.0.0.Beta12//org.jboss.as.controller.ModelControllerImpl.boot(ModelControllerImpl.java:533)
      at org.jboss.as.controller@19.0.0.Beta12//org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:572)
      at org.jboss.as.controller@19.0.0.Beta12//org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:534)
      at org.jboss.as.server@19.0.0.Beta12//org.jboss.as.server.ServerService.boot(ServerService.java:470)
      at org.jboss.as.server@19.0.0.Beta12//org.jboss.as.server.ServerService.boot(ServerService.java:414)
      at org.jboss.as.controller@19.0.0.Beta12//org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:473)
      at java.base/java.lang.Thread.run(Thread.java:829)
      
      16:02:18,513 FATAL [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0056: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details. - Server configuration file in use: standalone.xml

      This is the YAML content I tried (with various alternatives but always with the same result)

      wildfly-configuration:
        subsystem:
          logging:
            json-formatter:
              NDJSON:
                print-details: true
                exception-output-type: formatted
                meta-data:
                  app: my-application
      

              ehugonne1@redhat.com Emmanuel Hugonnet
              ehugonne1@redhat.com Emmanuel Hugonnet
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: