Spring boot Spring启动失败-ConfigurationProperties引发UnboundConfigurationPropertiesException

Spring boot Spring启动失败-ConfigurationProperties引发UnboundConfigurationPropertiesException,spring-boot,Spring Boot,我将一个应用程序从spring boot 1.5.9迁移到了2.2.4,现在我遇到了以下问题: *************************** APPLICATION FAILED TO START *************************** Description: Binding to target [Bindable@1f5150ed type = com.domain.config.RolesConfig, value = 'provided', annotati

我将一个应用程序从spring boot 1.5.9迁移到了2.2.4,现在我遇到了以下问题:

***************************
APPLICATION FAILED TO START
***************************

Description:

Binding to target [Bindable@1f5150ed type = com.domain.config.RolesConfig, value = 'provided', annotations = array<Annotation>[@org.springframework.boot.context.properties.ConfigurationProperties(ignoreInvalidFields=false, ignoreUnknownFields=false, prefix=role, value=role)]] failed:

    Property: role.rolebuctravelwatchers
    Value: Admin
    Origin: "role.roleBucTravelWatchers" from property source "class path resource [application-dev.properties]"
    Reason: The elements [role.rolebuctravelwatchers,role.rolecommandcenter,role.roleemployee,role.rolefacility,role.rolegm,role.rolehr,role.rolehrwatchers,role.rolemanager,role.roleofficead,role.rolewatcherpm] were left unbound.
    Property: role.rolecommandcenter
    Value: Admin
    Origin: "role.roleCommandCenter" from property source "class path resource [application-dev.properties]"
    Reason: The elements [role.rolebuctravelwatchers,role.rolecommandcenter,role.roleemployee,role.rolefacility,role.rolegm,role.rolehr,role.rolehrwatchers,role.rolemanager,role.roleofficead,role.rolewatcherpm] were left unbound.
    Property: role.roleemployee
    Value: Student
    Origin: "role.roleEmployee" from property source "class path resource [application-dev.properties]"
    Reason: The elements [role.rolebuctravelwatchers,role.rolecommandcenter,role.roleemployee,role.rolefacility,role.rolegm,role.rolehr,role.rolehrwatchers,role.rolemanager,role.roleofficead,role.rolewatcherpm] were left unbound.
    Property: role.rolefacility
    Value: Admin
    Origin: "role.roleFacility" from property source "class path resource [application-dev.properties]"
    Reason: The elements [role.rolebuctravelwatchers,role.rolecommandcenter,role.roleemployee,role.rolefacility,role.rolegm,role.rolehr,role.rolehrwatchers,role.rolemanager,role.roleofficead,role.rolewatcherpm] were left unbound.
    Property: role.rolegm
    Value: Admin
    Origin: "role.roleGM" from property source "class path resource [application-dev.properties]"
    Reason: The elements [role.rolebuctravelwatchers,role.rolecommandcenter,role.roleemployee,role.rolefacility,role.rolegm,role.rolehr,role.rolehrwatchers,role.rolemanager,role.roleofficead,role.rolewatcherpm] were left unbound.
    Property: role.rolehr
    Value: Admin
    Origin: "role.roleHR" from property source "class path resource [application-dev.properties]"
    Reason: The elements [role.rolebuctravelwatchers,role.rolecommandcenter,role.roleemployee,role.rolefacility,role.rolegm,role.rolehr,role.rolehrwatchers,role.rolemanager,role.roleofficead,role.rolewatcherpm] were left unbound.
    Property: role.rolehrwatchers
    Value: Admin
    Origin: "role.roleHRWatchers" from property source "class path resource [application-dev.properties]"
    Reason: The elements [role.rolebuctravelwatchers,role.rolecommandcenter,role.roleemployee,role.rolefacility,role.rolegm,role.rolehr,role.rolehrwatchers,role.rolemanager,role.roleofficead,role.rolewatcherpm] were left unbound.
    Property: role.rolemanager
    Value: Admin
    Origin: "role.roleManager" from property source "class path resource [application-dev.properties]"
    Reason: The elements [role.rolebuctravelwatchers,role.rolecommandcenter,role.roleemployee,role.rolefacility,role.rolegm,role.rolehr,role.rolehrwatchers,role.rolemanager,role.roleofficead,role.rolewatcherpm] were left unbound.
    Property: role.roleofficead
    Value: Admin
    Origin: "role.roleOfficeAD" from property source "class path resource [application-dev.properties]"
    Reason: The elements [role.rolebuctravelwatchers,role.rolecommandcenter,role.roleemployee,role.rolefacility,role.rolegm,role.rolehr,role.rolehrwatchers,role.rolemanager,role.roleofficead,role.rolewatcherpm] were left unbound.
    Property: role.rolewatcherpm
    Value: Admin
    Origin: "role.roleWatcherPM" from property source "class path resource [application-dev.properties]"
    Reason: The elements [role.rolebuctravelwatchers,role.rolecommandcenter,role.roleemployee,role.rolefacility,role.rolegm,role.rolehr,role.rolehrwatchers,role.rolemanager,role.roleofficead,role.rolewatcherpm] were left unbound.

Action:

Update your application's configuration

21:27:24,446 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 76) MSC000001: Failed to start service jboss.deployment.unit."App-0.0.1-SNAPSHOT.war".undertow-deployment: org.jboss.msc.service.StartException in service jboss.deployment.unit."App-0.0.1-SNAPSHOT.war".undertow-deployment: java.lang.RuntimeException: org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'rolesConfig': Could not bind properties to 'RolesConfig' : prefix=role, ignoreInvalidFields=false, ignoreUnknownFields=false; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'role' to com.domain.config.RolesConfig
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:81)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
    at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
    at java.lang.Thread.run(Thread.java:748)
    at org.jboss.threads.JBossThread.run(JBossThread.java:485)
Caused by: java.lang.RuntimeException: org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'rolesConfig': Could not bind properties to 'RolesConfig' : prefix=role, ignoreInvalidFields=false, ignoreUnknownFields=false; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'role' to com.domain.config.RolesConfig
    at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:252)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:96)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:78)
    ... 8 more
Caused by: org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'rolesConfig': Could not bind properties to 'RolesConfig' : prefix=role, ignoreInvalidFields=false, ignoreUnknownFields=false; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'role' to com.domain.config.RolesConfig
    at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.bind(ConfigurationPropertiesBindingPostProcessor.java:110)
    at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(ConfigurationPropertiesBindingPostProcessor.java:96)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:416)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1788)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
    at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:152)
    at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:132)
    at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:92)
    at com.domain.Application.onStartup(Application.java:34)
    at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:172)
    at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:203)
    at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:185)
    at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
    at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
    at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
    at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:250)
    ... 10 more
Caused by: org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'role' to com.domain.config.RolesConfig
    at org.springframework.boot.context.properties.bind.Binder.handleBindError(Binder.java:364)
    at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:324)
    at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:308)
    at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:238)
    at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:225)
    at org.springframework.boot.context.properties.ConfigurationPropertiesBinder.bind(ConfigurationPropertiesBinder.java:89)
    at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.bind(ConfigurationPropertiesBindingPostProcessor.java:107)
    ... 42 more
Caused by: org.springframework.boot.context.properties.bind.UnboundConfigurationPropertiesException: The elements [role.rolebuctravelwatchers,role.rolecommandcenter,role.roleemployee,role.rolefacility,role.rolegm,role.rolehr,role.rolehrwatchers,role.rolemanager,role.roleofficead,role.rolewatcherpm] were left unbound.
    at org.springframework.boot.context.properties.bind.handler.NoUnboundElementsBindHandler.checkNoUnboundElements(NoUnboundElementsBindHandler.java:83)
    at org.springframework.boot.context.properties.bind.handler.NoUnboundElementsBindHandler.onFinish(NoUnboundElementsBindHandler.java:71)
    at org.springframework.boot.context.properties.bind.Binder.handleBindResult(Binder.java:340)
    at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:321)
    ... 47 more

21:27:24,485 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "App-0.0.1-SNAPSHOT.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"App-0.0.1-SNAPSHOT.war\".undertow-deployment" => "java.lang.RuntimeException: org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'rolesConfig': Could not bind properties to 'RolesConfig' : prefix=role, ignoreInvalidFields=false, ignoreUnknownFields=false; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'role' to com.domain.config.RolesConfig
    Caused by: java.lang.RuntimeException: org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'rolesConfig': Could not bind properties to 'RolesConfig' : prefix=role, ignoreInvalidFields=false, ignoreUnknownFields=false; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'role' to com.domain.config.RolesConfig
    Caused by: org.springframework.boot.context.properties.ConfigurationPropertiesBindException: Error creating bean with name 'rolesConfig': Could not bind properties to 'RolesConfig' : prefix=role, ignoreInvalidFields=false, ignoreUnknownFields=false; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'role' to com.domain.config.RolesConfig
    Caused by: org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'role' to com.domain.config.RolesConfig
    Caused by: org.springframework.boot.context.properties.bind.UnboundConfigurationPropertiesException: The elements [role.rolebuctravelwatchers,role.rolecommandcenter,role.roleemployee,role.rolefacility,role.rolegm,role.rolehr,role.rolehrwatchers,role.rolemanager,role.roleofficead,role.rolewatcherpm] were left unbound."}}
和我的RoleConfig java类:

package com.domain.config;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.security.core.context.SecurityContextHolder;

@Configuration
@PropertySource("classpath:${spring.profiles.active}.properties")
@ConfigurationProperties(prefix = "role", ignoreUnknownFields = false)
public class RolesConfig {

    private final static String rolePrefix = "ROLE_";

    public static String roleGM;
    public static String roleOfficeAD;
    public static String roleFacility;
    public static String roleManager;
    public static String roleHR;
    public static String roleHRWatchers;
    public static String roleWatcherPM;
    public static String roleExternalWatcher;
    public static String roleEmployee;
    public static String roleCommandCenter;
    public static String roleBucTravelWatchers;

    public Set<String> getAllRoles() {
        return Arrays.asList(this.getClass().getDeclaredFields()).stream().map(field -> {
            try {
                return field.get(new String());
            } catch (IllegalArgumentException | IllegalAccessException e) {
                return null;
            }
        }).filter(p -> {
            return p != null && !p.equals("ROLE_");
        }).map(p -> {
            return p.toString();
        }).collect(Collectors.toCollection(HashSet<String>::new));
    }

    private static String getFormatedRole(String role) {
        return rolePrefix + role.toUpperCase();
    }

    public boolean isUserInRoles(String... arg) {
        List<String> roles = new ArrayList<String>(Arrays.asList(arg));
        return SecurityContextHolder.getContext()
                                    .getAuthentication()
                                    .getAuthorities()
                                    .stream()
                                    .map(p -> {
                                        return p.toString();
                                    }).anyMatch(p -> roles.contains(p));
    }

    public static String getRoleGM() {
        return roleGM;
    }

    public static void setRoleGM(String roleGM) {
        RolesConfig.roleGM = getFormatedRole(roleGM);
    }

    public static String getRoleOfficeAD() {
        return roleOfficeAD;
    }

    public static void setRoleOfficeAD(String roleOfficeAD) {
        RolesConfig.roleOfficeAD = getFormatedRole(roleOfficeAD);
    }

    public static String getRoleFacility() {
        return roleFacility;
    }

    public static void setRoleFacility(String roleFacility) {
        RolesConfig.roleFacility = getFormatedRole(roleFacility);
    }

    public static String getRoleManager() {
        return roleManager;
    }

    public static void setRoleManager(String roleManager) {
        RolesConfig.roleManager = getFormatedRole(roleManager);
    }

    public static String getRoleHR() {
        return roleHR;
    }

    public static void setRoleHR(String roleHR) {
        RolesConfig.roleHR = getFormatedRole(roleHR);
    }

    public static String getRoleHRWatchers() {
        return roleHRWatchers;
    }

    public static void setRoleHRWatchers(String roleHRWatchers) {
        RolesConfig.roleHRWatchers = getFormatedRole(roleHRWatchers);
    }

    public static String getRoleWatcherPM() {
        return roleWatcherPM;
    }

    public static void setRoleWatcherPM(String roleWatcherPM) {
        RolesConfig.roleWatcherPM = getFormatedRole(roleWatcherPM);
    }

    public static String getRoleExternalWatcher() {
        return roleExternalWatcher;
    }

    public static void setRoleExternalWatcher(String roleExternalWatcher) {
        RolesConfig.roleExternalWatcher = getFormatedRole(roleExternalWatcher);
    }

    public static String getRoleEmployee() {
        return roleEmployee;
    }

    public static void setRoleEmployee(String roleEmployee) {
        RolesConfig.roleEmployee = getFormatedRole(roleEmployee);
    }

    public static String getRoleCommandCenter() {
        return roleCommandCenter;
    }

    public static void setRoleCommandCenter(String roleCommandCenter) {
        RolesConfig.roleCommandCenter = getFormatedRole(roleCommandCenter);
    }

    public static String getRoleBucTravelWatchers() {
        return roleBucTravelWatchers;
    }

    public static void setRoleBucTravelWatchers(String roleBucTravelWatchers) {
        RolesConfig.roleBucTravelWatchers = getFormatedRole(roleBucTravelWatchers);
    }

}

删除@Configuration会在整个应用程序中引起其他bug,正如我看到一些人建议的那样。 此外,删除ignoreUnknownFields会使应用程序完成构建,但字段中的值为null


我不明白为什么这不管用了。我能找到的所有资源都做同样的事情。这在以前是有效的,没有任何问题。有人能告诉我我做错了什么吗

在spring boot中@EnableConfigurationProperties不是必需的。但是,您确实需要为@ConfigurationProperties注释处理器添加依赖项


你用@EnableConfigurationProperties注释你的主类了吗?你好@DanielJacob是的,我没有,我不知道这在整个静态字段中是如何工作的。“有没有可能把它们变成非静态的?”安德烈·伊斯法特说,它以前确实有效。更改的复杂性在于,在我的html代码中,我进行了如下验证:在很多地方,因为这是一个大项目,依赖项已经存在于我的pom.xml文件中。删除@EnableConfigurationProperties也没有任何作用。请仔细查看stacktrace:application-dev.properties和您的文件在camelcase中具有这些属性,但它正在尝试绑定不具有这些属性的属性。请检查您的通用application.properties(如果没有)。如果是这样的话,那么您需要一个@Profiledev注释,或者在您的application.properties中添加spring.profiles.active=dev。我同意您的看法,但我已经尝试过了。该文件具有camelCase属性。我的application.properties没有这些属性。它们仅存在于my application-dev.properties和application-prod.properties文件中。在我的application.properties文件中,我确实有spring.profiles.active=application-dev。还有一个关于放松绑定的问题:所以这不应该是一个问题属性:role.roleemployee值:学生来源:role.roleemployee from property源类路径资源[application-dev.properties]原因:元素[role.rolebucturtravelwatchers,role.rolecommandcenter,role.role员工,role.rolefacity,role.rolegm,role.rolehr,role.rolehrwatchers,role.rolemanager,role.roleofficead,role.rolewatcherpm]未绑定。我尝试使用所有lowers,但这不会剪切itProperty:role.role-employee值:学生来源:role.role-employee从属性源类路径资源[application-dev.properties]原因:元素[role.role buc travel watchers、role.role command center、role.role employee、role.role facility、role.role gm、role.role hr、role.role hr watchers、role.role manager、role.role office ad、role.role watcher pm]未绑定。或烤肉串案例
package com.domain.config;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.security.core.context.SecurityContextHolder;

@Configuration
@PropertySource("classpath:${spring.profiles.active}.properties")
@ConfigurationProperties(prefix = "role", ignoreUnknownFields = false)
public class RolesConfig {

    private final static String rolePrefix = "ROLE_";

    public static String roleGM;
    public static String roleOfficeAD;
    public static String roleFacility;
    public static String roleManager;
    public static String roleHR;
    public static String roleHRWatchers;
    public static String roleWatcherPM;
    public static String roleExternalWatcher;
    public static String roleEmployee;
    public static String roleCommandCenter;
    public static String roleBucTravelWatchers;

    public Set<String> getAllRoles() {
        return Arrays.asList(this.getClass().getDeclaredFields()).stream().map(field -> {
            try {
                return field.get(new String());
            } catch (IllegalArgumentException | IllegalAccessException e) {
                return null;
            }
        }).filter(p -> {
            return p != null && !p.equals("ROLE_");
        }).map(p -> {
            return p.toString();
        }).collect(Collectors.toCollection(HashSet<String>::new));
    }

    private static String getFormatedRole(String role) {
        return rolePrefix + role.toUpperCase();
    }

    public boolean isUserInRoles(String... arg) {
        List<String> roles = new ArrayList<String>(Arrays.asList(arg));
        return SecurityContextHolder.getContext()
                                    .getAuthentication()
                                    .getAuthorities()
                                    .stream()
                                    .map(p -> {
                                        return p.toString();
                                    }).anyMatch(p -> roles.contains(p));
    }

    public static String getRoleGM() {
        return roleGM;
    }

    public static void setRoleGM(String roleGM) {
        RolesConfig.roleGM = getFormatedRole(roleGM);
    }

    public static String getRoleOfficeAD() {
        return roleOfficeAD;
    }

    public static void setRoleOfficeAD(String roleOfficeAD) {
        RolesConfig.roleOfficeAD = getFormatedRole(roleOfficeAD);
    }

    public static String getRoleFacility() {
        return roleFacility;
    }

    public static void setRoleFacility(String roleFacility) {
        RolesConfig.roleFacility = getFormatedRole(roleFacility);
    }

    public static String getRoleManager() {
        return roleManager;
    }

    public static void setRoleManager(String roleManager) {
        RolesConfig.roleManager = getFormatedRole(roleManager);
    }

    public static String getRoleHR() {
        return roleHR;
    }

    public static void setRoleHR(String roleHR) {
        RolesConfig.roleHR = getFormatedRole(roleHR);
    }

    public static String getRoleHRWatchers() {
        return roleHRWatchers;
    }

    public static void setRoleHRWatchers(String roleHRWatchers) {
        RolesConfig.roleHRWatchers = getFormatedRole(roleHRWatchers);
    }

    public static String getRoleWatcherPM() {
        return roleWatcherPM;
    }

    public static void setRoleWatcherPM(String roleWatcherPM) {
        RolesConfig.roleWatcherPM = getFormatedRole(roleWatcherPM);
    }

    public static String getRoleExternalWatcher() {
        return roleExternalWatcher;
    }

    public static void setRoleExternalWatcher(String roleExternalWatcher) {
        RolesConfig.roleExternalWatcher = getFormatedRole(roleExternalWatcher);
    }

    public static String getRoleEmployee() {
        return roleEmployee;
    }

    public static void setRoleEmployee(String roleEmployee) {
        RolesConfig.roleEmployee = getFormatedRole(roleEmployee);
    }

    public static String getRoleCommandCenter() {
        return roleCommandCenter;
    }

    public static void setRoleCommandCenter(String roleCommandCenter) {
        RolesConfig.roleCommandCenter = getFormatedRole(roleCommandCenter);
    }

    public static String getRoleBucTravelWatchers() {
        return roleBucTravelWatchers;
    }

    public static void setRoleBucTravelWatchers(String roleBucTravelWatchers) {
        RolesConfig.roleBucTravelWatchers = getFormatedRole(roleBucTravelWatchers);
    }

}