diff --git a/controller/src/main/java/org/jboss/as/controller/logging/ControllerLogger.java b/controller/src/main/java/org/jboss/as/controller/logging/ControllerLogger.java index b515c1bceb4..45bc9bdf725 100644 --- a/controller/src/main/java/org/jboss/as/controller/logging/ControllerLogger.java +++ b/controller/src/main/java/org/jboss/as/controller/logging/ControllerLogger.java @@ -3755,4 +3755,8 @@ OperationFailedRuntimeException capabilityAlreadyRegisteredInContext(String capa @Message(id = 505, value = "Unsuported deployment yaml file %s with attributes %s") IllegalArgumentException unsupportedDeployment(String deployment, Set attribues); + + @LogMessage(level = WARN) + @Message(id = 506, value = "The yaml element %s is ignored") + void ignoreYamlElement(String yaml); } diff --git a/controller/src/main/java/org/jboss/as/controller/persistence/yaml/YamlConfigurationExtension.java b/controller/src/main/java/org/jboss/as/controller/persistence/yaml/YamlConfigurationExtension.java index a5c1c443e54..01c5538e15b 100644 --- a/controller/src/main/java/org/jboss/as/controller/persistence/yaml/YamlConfigurationExtension.java +++ b/controller/src/main/java/org/jboss/as/controller/persistence/yaml/YamlConfigurationExtension.java @@ -103,8 +103,8 @@ private void load() { for (Path file : files) { if (file != null && Files.exists(file) && Files.isRegularFile(file)) { Map yamlConfig = Collections.emptyMap(); + Yaml yaml = new Yaml(new OperationConstructor(new LoaderOptions())); try (InputStream inputStream = Files.newInputStream(file)) { - Yaml yaml = new Yaml(new OperationConstructor(new LoaderOptions())); yamlConfig = yaml.load(inputStream); } catch (IOException ioex) { throw MGMT_OP_LOGGER.failedToParseYamlConfigurationFile(file.toAbsolutePath().toString(), ioex); @@ -115,6 +115,8 @@ private void load() { Object value = config.remove(excluded); if(value != null && value instanceof Map && DEPLOYMENT.equals(excluded)) { deployments.putAll((Map) value); + } else if (value != null){ + MGMT_OP_LOGGER.ignoreYamlElement(yaml.dump(value)); } } parsedFiles.add(file.toAbsolutePath().toString());