private static WebAppContext getInitContext(ViewConfig viewConfig) throws IOException {

    WebAppContext webAppContext = new WebAppContext();

    // add ambari classes as system classes
    webAppContext.getSystemClassMatcher().add("org.apache.ambari.server.");
    webAppContext.getSystemClassMatcher().add("org.apache.ambari.view.");

    // add com.google.inject as system classes to allow for injection in view components using the google annotation
    webAppContext.getSystemClassMatcher().add("com.google.inject.");

    // add as system classes to avoid conflicts and linkage errors
    webAppContext.getSystemClassMatcher().add("org.slf4j.");
    webAppContext.getSystemClassMatcher().add("com.sun.jersey.");
    webAppContext.getSystemClassMatcher().add("org.apache.velocity.");

    // set the class loader settings from the configuration
    if (viewConfig != null) {
      String extraClasspath = viewConfig.getExtraClasspath();
      if (extraClasspath != null) {
        webAppContext.setExtraClasspath(extraClasspath);
      }
    }
    return webAppContext;
  }
Constructs a new ViewClassLoader for the given URLs.
The URLs will be searched in the order specified for classes and resources before searching the specified
parent class loader.

@param viewConfig  the view configuration
@param parent      the parent class loader
@param urls        the URLs from which to load classes and resources
ambari-server/src/main/java/org/apache/ambari/server/view/ViewClassLoader.java