Thread thread = Thread.currentThread();
ClassLoader oldLoader = thread.getContextClassLoader();
try {
HostConfig hostConfig = new HostConfig();
hostConfig.setHostName(new RawString(_hostName));
hostConfig.setRootDirectory(new RawString("memory:/error/" + _hostName));
hostConfig.setSkipDefaultConfig(true);
hostConfig.setRedeployMode(DeployMode.MANUAL);
WebAppConfig webAppConfig = new WebAppConfig();
webAppConfig.setId("/");
webAppConfig.setRootDirectory(new RawString("memory:/error/ROOT"));
webAppConfig.setSkipDefaultConfig(true);
webAppConfig.setRedeployMode(DeployMode.MANUAL);
hostConfig.addPropertyProgram("web-app", webAppConfig);