SBTEnvironment parentEnvironment = SBTEnvironmentFactory.get(environmentName);
if (parentEnvironment == null) {
String message = MessageFormat.format("Unable to load environment: {0}", environmentName);
throw new ServletException(message);
}
parentEnvironment.prepareEndpoints();
environment = new RequestEnvironment(params, parentEnvironment);
}
if (environment == null) {
if(defaultEnvironment != null) {
defaultEnvironment.prepareEndpoints();